![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
General Help All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: Jan 2007
Beans: 20
|
PHP5 from apt-get and PDO
I was wondering if anyone knows how to get the PDO classes installed for PHP5 because it seems that they were not installed when I did an apt-get for php5. Will I have to manually compile it or is their a repository for this?
|
|
|
|
|
|
#2 |
|
Just Give Me the Beans!
![]() Join Date: Feb 2007
Location: North Devon
Beans: 79
Ubuntu 8.10 Intrepid Ibex
|
Re: PHP5 from apt-get and PDO
System > Administration > Synaptic Package Manager
Use the search feature and search for "php-db". It should be the first result. |
|
|
|
|
|
#3 |
|
5 Cups of Ubuntu
![]() Join Date: Jan 2007
Beans: 20
|
Re: PHP5 from apt-get and PDO
what i see for php-db is PHP PEAR Database Abstraction Layer which I was told in freenode is not the pdo package.
|
|
|
|
|
|
#4 |
|
Gee! These Aren't Roasted!
![]() |
Re: PHP5 from apt-get and PDO
I had this problem just yesterday (and yes, php-db installation is...useless). I dunno EXACTLY what I did, but I've installed php5-dev, mysqlclient15-dev (or something) and then ran PECL INSTALL PDO and PECL INSTALL PDO_MYSQL. Seems to work, but it wont parse queries on execute (replacing ? with data from array) yet. Hope that helps.
EDIT: oh yeah, don't forget to add both extensions to php.ini (pdo.so and pdo_mysql.so) Last edited by theh0g; February 21st, 2007 at 04:56 PM.. |
|
|
|
|
|
#5 |
|
5 Cups of Ubuntu
![]() Join Date: Dec 2005
Beans: 18
Kubuntu 7.10 Gutsy Gibbon
|
Re: PHP5 from apt-get and PDO
Here's a more exact description to install pdo on top of the php5 packages provided by ubuntu (so this procedure assumes you already installed php and a webserver):
1) make sure you install the ubuntu package php-pear. I used synaptic for that but the command line should work too of course: Code:
sudo apt-get install php-pear 2) install pdo: Code:
sudo pecl install pdo Code:
Build process completed successfully Installing '/var/tmp/pear-build-root/install-PDO-1.0.3//usr/lib/php5/20051025/pdo.so' Installing '/var/tmp/pear-build-root/install-PDO-1.0.3//usr/include/php/ext/pdo/php_pdo.h' Installing '/var/tmp/pear-build-root/install-PDO-1.0.3//usr/include/php/ext/pdo/php_pdo_driver.h' install ok: channel://pecl.php.net/PDO-1.0.3 You should add "extension=pdo.so" to php.ini Check the php documentation to find out your prerequisites. For example, to install pdo_mysql, I first installed the mysql php extension: Code:
sudo apt-get install php5-mysql After that, install the pdo_mysql package again using the php packaging system rather than the ubuntu packages: Code:
sudo pecl install pdo_mysql Code:
Build process completed successfully Installing '/var/tmp/pear-build-root/install-PDO_MYSQL-1.0.2//usr/lib/php5/20051025/pdo_mysql.so' install ok: channel://pecl.php.net/PDO_MYSQL-1.0.2 You should add "extension=pdo_mysql.so" to php.ini Code:
sudo kedit /etc/php5/apache2/php.ini Code:
extension=pdo.so extension=pdo_mysql.so 6) Restart apache to let the changes take effect: Code:
cd /etc/init.d sudo apache2 -k restart Good luck, and kind regards Roland |
|
|
|
|
|
#6 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2006
Beans: 22
|
Re: PHP5 from apt-get and PDO
I'd like to add to that:
if you get an error "phpize not found" after trying to install pdo through pecl (sudo pecl install pdo), you should install the php5-dev package. Code:
sudo apt-get install php5-dev Code:
checking for MySQL support for PDO... yes, shared checking for mysql_config... not found configure: error: Cannot find MySQL header files under ERROR: `/tmp/tmpRiQ5ax/PDO_MYSQL-1.0.2/configure' failed Code:
sudo apt-get install libmysqlclient15-dev Last edited by relix; March 25th, 2007 at 06:51 AM.. Reason: Added second error |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|