Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st April 2006, 18:38
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Post PhpMysql with ISP-Server Setup - Ubuntu 5.10 "Breezy Badger"

I followed the setup ISP-Server Setup - Ubuntu 5.10 "Breezy Badger",
The problem i have is that phpmysql is not running, when i do the command php-m, phpmysql is not in the list.
I didn't comment out de php things, because i don't setup ispconfig.
I tried the solutions mentioned below.

1. Reinstal php4-mysql by running:
apt-get install php4-mysql
root@drbyte:apt-get install php4-mysql
Reading package lists... Done
Building dependency tree... Done
php4-mysql is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

2. Uncommented the line in php.ine wich reads mysql.so
/etc/init.dapache2 restart, still no phpmysql running.

I also searched the internet for a week of 2 now, but still haven't found a solution for this. I found that there a lot of pepople who have also this problem.

When i run a php script in a terminal wich connects to a mysql database i get the following error.

Fatal error: Call to undefined function mysql_select_db() in /var/www/usnet/inc/optimize_database_2.php on line 8

I hope to find a solution with help from this forum.

Last edited by Yabadoo; 1st April 2006 at 19:39.
Reply With Quote
Sponsored Links
  #2  
Old 1st April 2006, 21:17
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Therea re two php.ini files. One for the mod_php and one for the cli php.

Run:

locate php.ini

to get the locations of both files and check if the mysql.so extension for php is enabled in both php.ini config files.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 1st April 2006, 21:24
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

I did locate php.ini, below the output.
/etc/php4/apache2/php.ini
/etc/php4/cli/php.ini
/etc/php5/cli/php.ini
/usr/share/doc/php4-common/examples/php.ini-dist
/usr/share/doc/php4-common/examples/php.ini-paranoid
/usr/share/doc/php4-common/examples/php.ini-recommended
/usr/share/doc/php5-common/examples/php.ini-dist
/usr/share/doc/php5-common/examples/php.ini-paranoid
/usr/share/doc/php5-common/examples/php.ini-recommended
/usr/share/php4/php.ini-dist
/usr/share/php5/php.ini-dist

I didn't install php5?, but i looked in both php.ini's, the one in
/etc/php4/apache and the one in /etc.php4/cli, in both file's mysql.so is uncommented.
Reply With Quote
  #4  
Old 1st April 2006, 21:31
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Maybe your commandline php is php5 and not php4. Please check with the "-v" option which version number your cli php has.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 1st April 2006, 21:34
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

See below the output of php -v

root@drbyte:# php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20041030/mysql.so' - /usr/lib/php5/20041030/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.0.5-2ubuntu1.2 (cli) (built: Mar 8 2006 08:18:34)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies

So you are right how, i use php5, strange.
How can i go back to php4?
Reply With Quote
  #6  
Old 1st April 2006, 21:38
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Execute:

which php

to get the location of the php command. Then check with (replace path with the path you got above):

ls -la /path/to/php

if the php command is a binary or a symlink to the php5 binary. If its a symlink, you can set a new symlink to your php4 binary.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 1st April 2006, 21:43
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

root@drbyte:# which php
/usr/bin/php

root@drbyte:# ls -la /usr/bin/php
lrwxrwxrwx 1 root root 21 2006-03-19 10:38 /usr/bin/php -> /etc/alternatives/php (cyan color)

root@drbyte:# ls -la /etc/alternatives/php
lrwxrwxrwx 1 root root 13 2006-03-25 16:36 /etc/alternatives/php -> /usr/bin/php5 (green color)

So the last line is where it goes wrong, but now i don't know how to correct this.

Last edited by Yabadoo; 1st April 2006 at 23:08.
Reply With Quote
  #8  
Old 2nd April 2006, 18:30
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Do you have a file /usr/bin/php4 ?

If so, remove /usr/bin/php and set a new symlink pointing from /usr/bin/php -> /usr/bin/php4
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 2nd April 2006, 18:48
Yabadoo Yabadoo is offline
Member
 
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Yes there is a file php4 in /usr/bin.

1. What is the best way to remove the /usr/bin/php
rm /usr/bin/php

2. Is this the way to create a new symlink
ln -s /usr/bin/php4 ./usr/bin/php

3. What about the other link /etc/alternatives/php

I just want to know for sure before my server stops working....
Reply With Quote
  #10  
Old 2nd April 2006, 23:29
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
 
Default

Quote:
Originally Posted by Yabadoo
Yes there is a file php4 in /usr/bin.

1. What is the best way to remove the /usr/bin/php
rm /usr/bin/php
Don't remove it!

Just run
Code:
rm -f /etc/alternatives/php
ln -s /usr/bin/php4 /etc/alternatives/php
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Statistic not working mzo Installation/Configuration 49 20th April 2011 13:19
How To ISP Server setup with Ubuntu 5.10 (Breezy Badger) gymsmoke HOWTO-Related Questions 26 29th April 2006 14:46
Questions in regards to ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" rbrantley HOWTO-Related Questions 16 10th April 2006 19:26
ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" --> PHP5 spudse HOWTO-Related Questions 1 30th March 2006 16:50
ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" & PHP Brenton HOWTO-Related Questions 2 19th October 2005 20:03


All times are GMT +2. The time now is 15:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.