• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

mysql_connect() error

R

rogerwilcos

Guest
I performed an install of Plesk 8.0 on Fedorea Core 4. Plesk works just fine, I can bring up MySQL databases within it...but when I go to any of the pages that connect to the databases it says:

Call to undefined function mysql_connect()

I have looked an php-mysql, mysql, php and all the needed packages are installed.

I would do yum remove php php-mysql and reinstall it but it looks like its going to try to remove a zillion dependencies that are plesk specific.

Please help, any suggestions are greatly appreciated.
 
It's a PHP5 things. PHP5 unbundled mysql from the base install so you need to make sure that the mysql libraries are enabled in php.ini
 
How would I do that. Could you show me what line needs to be in their? Why does mysql work in the plesk control panel...its written in php isnt it?
 
Okay I figured it out so for those of you having the same trouble:

edit /etc/php.ini

add these two lines:

extension=mysql.so
extension=mysqli.so

Save the file then type: apachectl restart

This solved the problem for me, I hope it helps someone else out.
 
Plesk apache runs php5, httpd apache for webserver runs php4, there are different versions to httpd and php, too. (plesk runs only SSL httpd ! through Apache version 1 vs webserver's Apache 2)

Compare php.ini with the php.ini.saved_from_psa or php.ini.rpmsave and also check the others of plesk use in psa dir e.g: /usr/local/psa/admin/conf/php.ini
so you can find what were the extensions used or not when databases worked in the past.

Which version of mysql runs on your box?
 
Originally posted by rogerwilcos
Okay I figured it out so for those of you having the same trouble:

edit /etc/php.ini

add these two lines:

extension=mysql.so
extension=mysqli.so

Save the file then type: apachectl restart

This solved the problem for me, I hope it helps someone else out.

Many thanks!!! I had the same problem with php & mysql on Plesk8.

I was searching for the solution, but came on the same fix.

Thanks!
 
Back
Top