1

I followed this guide to install PHP 5.3 on my CentOS 5 server:
http://www.webtatic.com/packages/php53/

I have phpMyAdmin extracted in a directory but it says it can't find the mysql extension. Moreover, I know I'll need the mysqli extension for other programs such as Drupal. The guide I followed says that those extensions come with it. When I run php -m it shows both mysql and mysqli though - that's where I'm puzzled.

I restarted apache and still no go. Where do you think my next step is?

phpinfo say my ini is in /etc/php.ini - should I be looking in there for something?

Thanks so much.

user1062058
  • 505
  • 2
  • 10
  • 17

2 Answers2

2

I have phpMyAdmin extracted in a directory but it says it can't find the mysql extension.

Make sure that php-mysql is installed:

# yum --enablerepo=webtatic install php-mysql

Don't forget to restart the Apache after that.

quanta
  • 51,413
  • 19
  • 159
  • 217
  • did an rpm -qa and it shows php-mysql-5.3.8-1.w5 installed. I checked to see if they, mysqli and mysql, were enabled in /etc/php.d and they are. Still no luck though. – user1062058 Dec 09 '11 at 15:32
  • When I do the php -m, it shows the packages at the bottom under [PHP Modules] - but at the top it says PHP Warning: PHP Startup: Unable to load dynamic library 'path to .so' ... it has this error for mysqli.so and mysql.so – user1062058 Dec 09 '11 at 15:41
  • Does it exist in `/usr/lib(64)/php/modules`? Did you try to reinstall php-mysql? – quanta Dec 09 '11 at 15:46
  • They are all in /usr/lib/php/modules/ - but when I cat them, it is just scrambed code. I couldn't cd to /usr/lib(64)/php/modules ... it gave me a syntax error. I didn't reinstall. I yum removed php-* and installed fresh following that guide. The only thing I added was the install php-mysql line you have in your answer. Everything should be fresh, I had php 5.0 on the server before, but I removed that with yum. Thanks for your help so far, I am so confused at this. – user1062058 Dec 09 '11 at 15:52
  • I just realized that the warnings are saying this directory: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/extensions/no-debug-non-zts-20060613/*.so' If I change those without the /no-debug-non-zts-20060613/ - which has only apc.so and memcache.so, to /usr/lib/php/modules - will that fix my problem? How can I tell php to point there? Am I on the right track or are these directories for different things? – user1062058 Dec 09 '11 at 15:56
  • UPDATE: I simply cp'ed all *.so in /usr/lib/php/modules/ to /usr/local/lib/extensions/no-debug-non-zts-20060613/ and everything seems to be working. phpMyAdmin loaded mysql extension. Is there anything to worry about with this fix? I'm marking this question as answered. Thanks, quanta. Apparently this is a bug in php 5.3 I read. – user1062058 Dec 09 '11 at 16:16
  • `grep extension_dir /etc/php.ini`? – quanta Dec 09 '11 at 16:30
  • it says "; extension_dir directove above." - there is nothing above. – user1062058 Dec 09 '11 at 16:44
  • What does it say on the `phpinfo()` page? I bet it is `/usr/local/lib/extensions/no-debug-non-zts-20060613`. – quanta Dec 09 '11 at 16:52
  • Yep! That's where it is. No big deal I guess. – user1062058 Dec 09 '11 at 17:17
0

Check /etc/php.d for mysql.ini and mysqli.ini as well

johnshen64
  • 5,865
  • 24
  • 17