cancel
Showing results for 
Search instead for 
Did you mean: 

LAMP php5

SOLVED
Go to solution
David_910
Occasional Visitor

LAMP php5

I have a new installation of Linux, Apache 1.3, mysql 4.0.1 and php 5.0.3 except that php appears not to be picking up the mysql functions.
I think the modules are all in the right places.
php.ini is copied from a working system with the same components.
But on the new system I get:
"Fatal error. Call to undefined function mysql_connect..."
Can anyone fix this?
Thanks
5 REPLIES
Gopi Sekar
Honored Contributor

Re: LAMP php5


looks like you dont have mysql plugin libraries for PHP.

if you have installed it from RedHat, then there should be an rpm by name php-mysql* install that rpm then you should be able to use that function.

if you have compiled your own version of php, then you may have to recompile php with mysql option. check the configure option in php to find out how to do this.

Regards,
Gopi
Never Never Never Giveup
Stuart Browne
Honored Contributor

Re: LAMP php5

Apache 1.3 + MySQL 4.0 + PHP 5? No RH distro comes with these.

As of RH8, all RH boxes ship with Apache 2, and to this day only ship with MySQL 3 and PHP 4.

In any case, Gopi is right. It looks like whoever set this system up needs to go back and re-compile PHP, making sure it finds the MySQL libraries, and compiles them in.

If this was done, as a module/extension, the 'php.ini' needs to have 'extesion=mysql.so' included too.
One long-haired git at your service...
David_910
Occasional Visitor

Re: LAMP php5

Thanks for such prompt replies

More info:

->Not RH but Debian
->I'm trying to clone a working system which has:

Apache 1.3
mysql 4
php5

all working happily.

->extension=mysql.so

is in php.ini because the new machine has copied the old's php.ini

When I run php.info on the old machine I get a mysql section.

When I run php.info on the old machine I get no mysql section.

Thanks again

Dave
Gopi Sekar
Honored Contributor
Solution

Re: LAMP php5


that shows that mysql is not linked in your new system.

how did you create this new machine, did you do everything from scratch(installation of Apache, mysql and php) or you just copied from running machine.

if the first case then it means you probably missed to add mysql extension when you compiled php. since you have copied php.ini from working machine it will have correct entry but php will try to locate mysql.so and can not locate it. if i am correct, phpinfo gives the exact command line of how php was compiled. Do the same way in the new machine also to get the php with same configuration as working machine

if the second case then you proabaly missed copying some files from running machine. try to find all *mysql* from working machine, compare the list and copy the files which are missed out on the new system

Regards,
Gopi
Never Never Never Giveup
Stuart Browne
Honored Contributor

Re: LAMP php5

.. /usr/lib/php*/ ..

that's where the modules/extensions live.

What do the HTTP error_log's say about the start-up of apache?

Or are you using PHP as a CGI, not as an apache module?
One long-haired git at your service...