
1st April 2006, 17:38
|
|
Member
|
|
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
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 18:39.
|

1st April 2006, 20:17
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,896
Thanks: 693
Thanked 4,191 Times in 3,207 Posts
|
|
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.
|

1st April 2006, 20:24
|
|
Member
|
|
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
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.
|

1st April 2006, 20:31
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,896
Thanks: 693
Thanked 4,191 Times in 3,207 Posts
|
|
Maybe your commandline php is php5 and not php4. Please check with the "-v" option which version number your cli php has.
|

1st April 2006, 20:34
|
|
Member
|
|
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
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?
|

1st April 2006, 20:38
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,896
Thanks: 693
Thanked 4,191 Times in 3,207 Posts
|
|
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.
|

1st April 2006, 20:43
|
|
Member
|
|
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
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 22:08.
|

2nd April 2006, 17:30
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,896
Thanks: 693
Thanked 4,191 Times in 3,207 Posts
|
|
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
|

2nd April 2006, 17:48
|
|
Member
|
|
Join Date: Apr 2006
Location: Noord-Brabant, Netherlands
Posts: 39
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
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....
|

2nd April 2006, 22:29
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 21:51.
|
Recent comments
12 hours 39 min ago
22 hours 7 min ago
22 hours 56 min ago
1 day 2 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 9 hours ago
1 day 19 hours ago
2 days 26 min ago
2 days 1 hour ago