How to configure PHP5 and Mysql 5

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
bacon
Posts: 2
Joined: 2006/11/22 20:43:33

How to configure PHP5 and Mysql 5

Post by bacon » 2006/11/22 21:05:10

I've read a ton of posts and the simple solutions out there don't seem to help me :-(

I upgraded my PHP and Mysql client/server on CentOS 4 to version 5 via the following command:

yum --enablerepo=centosplus update

It brought down a ton of updates, most of which i don't need but that's fine for now. I'm able to run mysql and it gives me version 5.

I've also tried upgrading / updating the php-mysql module but when I run 'yum [install or update] php-mysql' it tells me there's nothing to do.

My php info page states --without-mysql in the configure command section. I read in another post that this is suppose to be fine but in my opinion it's not b/c on the php info page there is no section for MySQL so this tells me that PHP knows nothing about MySQL or how to talk to it.

Is there any way I can run some type of ./configure script (although I'm not sure where yum actually installs php)? How do I get this to work.

The error I'm actually receiving from all this is

PHP Fatal error: Call to undefined function mysql_pconnect() in /var/www/intranet/app/include/db_mysql.php on line 60

I've also attached the top of my php info screen just incase that helps anyone.

Thank you for *any* help you can provide.

- Billy -

jasonxoxide
Posts: 80
Joined: 2006/09/11 14:35:48
Location: Exton, PA
Contact:

Re: How to configure PHP5 and Mysql 5

Post by jasonxoxide » 2006/11/23 19:00:24

Did you run "yum --enablerepo=centosplus install php-mysql" or just "yum install php-mysql"?

In either case, you might want to check out the How-to on my site (see sig link) for installing PHP 5.1.6.

bacon
Posts: 2
Joined: 2006/11/22 20:43:33

Re: How to configure PHP5 and Mysql 5

Post by bacon » 2006/11/27 14:17:35

Yes, I ran the following command and get the following output...

[root@localhost ~]# yum --enablerepo=centosplus install php-mysql
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@localhost ~]#

jasonxoxide
Posts: 80
Joined: 2006/09/11 14:35:48
Location: Exton, PA
Contact:

Re: How to configure PHP5 and Mysql 5

Post by jasonxoxide » 2006/11/27 17:26:27

What is the output of the command below?

[code]rpm -qa | grep php[/code]

gnosis
Posts: 4
Joined: 2005/09/08 16:59:36
Contact:

Re: How to configure PHP5 and Mysql 5

Post by gnosis » 2007/01/05 23:54:10

I'm having a very similar problem as the parent poster.

I upgraded to php5.1.6 via centosplus. It also upgraded MySQL to the 5 branch and several other packages as well, including php-mysql, php-xml, etc. The process went off without error and everything seemed to install just dandy.

But when I checked phpinfo, I find that the compile lists '--without-mysql' '--without-gd' '--without-pear' etc.

Where did it get the idea that I don't want these things? And how do I get them back now??

I checked for the relevant packages and they're all installed. The output of rpm -qa | grep php is below. Any ideas?

psa-php4-configurator-1.1.0-centos4.2.build81061129.22
phpAds-2.0.7-80015
phpDig-1.85-80017
phpsurveyor-0.98-80030
php51-dom-5.1.4-20060823.rhas4
php51-iconv-5.1.4-20060823.rhas4
php51-openssl-5.1.4-20060823.rhas4
php51-sockets-5.1.4-20060823.rhas4
php-imap-5.1.6-1.2.1.centos
php-xml-5.1.6-1.2.1.centos
phpBB-2.0.19-80012
phpBugTracker-1.19-80022
phpMoney-1.3-80027
phpWiki-1.3.11-80030
phpwebsite-0.10.2-80014
php-ioncube-loader-3.0-06101212
php51-5.1.4-20060823.rhas4
php51-curl-5.1.4-20060823.rhas4
php51-fastcgi-5.1.4-20060823.rhas4
php51-gd-5.1.4-20060823.rhas4
php51-mbstring-5.1.4-20060823.rhas4
php51-mysqli-5.1.4-20060823.rhas4
php51-pdo-5.1.4-20060823.rhas4
php51-posix-5.1.4-20060823.rhas4
php51-sqlite-5.1.4-20060823.rhas4
php51-zlib-5.1.4-20060823.rhas4
php-pear-1.4.9-1.2.centos
php-pgsql-5.1.6-1.2.1.centos
php-gd-5.1.6-1.2.1.centos
php-5.1.6-1.2.1.centos
phpBook-1.50-80020
phpMyFamily-1.4.1-80022
php5-ioncube-3.0-centos4.06112310
php51-ftp-5.1.4-20060823.rhas4
php51-mysql-5.1.4-20060823.rhas4
php51-pdo_mysql-5.1.4-20060823.rhas4
php51-xsl-5.1.4-20060823.rhas4
php-mysql-5.1.6-1.2.1.centos
php-mbstring-5.1.6-1.2.1.centos
php-pdo-5.1.6-1.2.1.centos

gnosis
Posts: 4
Joined: 2005/09/08 16:59:36
Contact:

Re: How to configure PHP5 and Mysql 5

Post by gnosis » 2007/01/06 02:35:58

[b]Disregard the above![/b]

This is a cross-post from the SWSoft forum (Plesk), but I thought people here might find this useful.

PHP is compiled this way on purpose. Modules are loaded in a different way now. I had seen other posts where people had seen this compile line but the features listed as "--without..." WERE working (as they should). Mine, however, were not. That is, they were not working for the [i]default[/i] domain.

I was going through all kinds of troubleshooting trying to figure out what was wrong. On a whim, I created a new vhost and, sure enough, my attempts to do tests on GD, MySQL connections, etc, were successful. The phpinfo() on the subdomain revealed that, while the configure line still showed "--without...", the modules were now reporting their config blocks like I would expect.

So everything was fine all along. But the combination of the misleading configure line and the Plesk default domain being crippled for some reason, I believed that something was broken.

vaene
Posts: 1
Joined: 2009/03/06 17:50:36

Re: How to configure PHP5 and Mysql 5

Post by vaene » 2009/03/06 17:56:08

[root@vps lib]# rpm -qa | grep php
php-common-5.2.9-1.el4.art
php-pear-1.7.2-2.el4.art
php-pdo-5.2.9-1.el4.art
php-imap-5.2.9-1.el4.art
php-devel-5.2.9-1.el4.art
php-snmp-5.2.9-1.el4.art
php-gd-5.2.9-1.el4.art
php-odbc-5.2.9-1.el4.art
php-xml-5.2.9-1.el4.art
psa-php4-configurator-1.4.0-cos4.build86080722.02
php-cli-5.2.9-1.el4.art
php-5.2.9-1.el4.art
php-mbstring-5.2.9-1.el4.art
php-pgsql-5.2.9-1.el4.art
php-ncurses-5.2.9-1.el4.art
php-mysql-5.2.9-1.el4.art
php-xmlrpc-5.2.9-1.el4.art
php-ldap-5.2.9-1.el4.art

having the same problem cannot get php5 compiled with mysql to work

Post Reply

Return to “CentOS 4 - Server Support”