ok so I am on a new OS. I am on ubuntu 7.10. I have installed php5, mysql and apache.. I am trying to run all the old scripts I have, and for some reason, I get this error on the index..
Fatal error: Call to undefined function mysql_connect() in /var/www/index.php on line 8
for every single script and tutorial I find, its always mysql_connect()
is there another command to connect to the database?????
The most basic php question..
Started by phpforfun, Apr 01 2008 06:22 PM
13 replies to this topic
#1
Posted 01 April 2008 - 06:22 PM
|
|
|
#2
Posted 01 April 2008 - 10:40 PM
really? 24 views, no comments?
#3
Posted 01 April 2008 - 11:56 PM
phpforfun said:
really? 24 views, no comments?
I initially ignored this as I figured you might search the forum and find the tutorial I wrote for setting up a LAMP server specifically on Ubuntu 7.1...
http://forum.codecal...ver-ubuntu.html
#4
Guest_Jordan_*
Posted 02 April 2008 - 03:48 AM
Guest_Jordan_*
It sounds like you have MySQL/Apache/PHP Setup or you wouldn't get a PHP error but it also sounds like you didn't compile MySQL into PHP (which I thought was built in now).
In your php.ini file (usually /etc/php.ini but I don't know about Ubuntu) make sure that this line:
is not commented (comments use a # sign).
Restart Apache and see if you get the error.
In your php.ini file (usually /etc/php.ini but I don't know about Ubuntu) make sure that this line:
extension=mysql.so
is not commented (comments use a # sign).
Restart Apache and see if you get the error.
#5
Posted 02 April 2008 - 07:51 AM
John said:
I initially ignored this as I figured you might search the forum and find the tutorial I wrote for setting up a LAMP server specifically on Ubuntu 7.1...
http://forum.codecal...ver-ubuntu.html
http://forum.codecal...ver-ubuntu.html
Jordan said:
It sounds like you have MySQL/Apache/PHP Setup or you wouldn't get a PHP error but it also sounds like you didn't compile MySQL into PHP (which I thought was built in now).
In your php.ini file (usually /etc/php.ini but I don't know about Ubuntu) make sure that this line:
is not commented (comments use a # sign).
Restart Apache and see if you get the error.
In your php.ini file (usually /etc/php.ini but I don't know about Ubuntu) make sure that this line:
extension=mysql.so
is not commented (comments use a # sign).
Restart Apache and see if you get the error.
I will do that when I get home. I fugured any apache has mysql in it... I didnt see why it wouldnt. Thanks jordan.
#6
Posted 02 April 2008 - 12:44 PM
Jordan said:
It sounds like you have MySQL/Apache/PHP Setup or you wouldn't get a PHP error but it also sounds like you didn't compile MySQL into PHP (which I thought was built in now).
In your php.ini file (usually /etc/php.ini but I don't know about Ubuntu) make sure that this line:
is not commented (comments use a # sign).
Restart Apache and see if you get the error.
In your php.ini file (usually /etc/php.ini but I don't know about Ubuntu) make sure that this line:
extension=mysql.so
is not commented (comments use a # sign).
Restart Apache and see if you get the error.
For anyone who followed my tutorial, php.ini will be located in /etc/php5/apache2/, but for those who did followed my tutorial, configuration should not be necessary.
#7
Posted 02 April 2008 - 12:51 PM
John said:
For anyone who followed my tutorial, php.ini will be located in /etc/php5/apache2/, but for those who did followed my tutorial, configuration should not be necessary.
thats funny, because my php.ini is located in /etc/, not /etc/php5/apache2. Ill look more into this when I get home.
Forgot to setup ssh :(
Edited by phpforfun, 02 April 2008 - 12:55 PM.
#8
Posted 02 April 2008 - 04:59 PM
edited the code in php.ini
Restarted apache
Restarted MySQL
Still get the error...
Quote
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
extension=msql.so
;
;
; extension=msql.dll
;
; ... or under UNIX:
;
extension=msql.so
;
Quote
justin@Justin-Ubuntu:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
justin@Justin-Ubuntu:~$
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
justin@Justin-Ubuntu:~$
Quote
justin@Justin-Ubuntu:~$ sudo /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
justin@Justin-Ubuntu:~$
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
justin@Justin-Ubuntu:~$
Still get the error...
#9
Posted 02 April 2008 - 05:09 PM
#10
Posted 02 April 2008 - 05:33 PM
John said:
msql != mysql
msql or mysql? And do I insert that in there anywhere?
#11
Posted 02 April 2008 - 07:06 PM
If you want PHP to load the mysql extension you need to add/uncomment this line: if you want to load msql [microsoft sql] add/uncomment this line:
Quote
extension=mysql.so
Quote
extension=msql.so
#12
Posted 02 April 2008 - 09:53 PM
ok I got it, I just deleted MySQL, and PHP, reinstalled it, works... ok
Thanks a lot john and jordan!
Thanks a lot john and jordan!
Edited by phpforfun, 02 April 2008 - 09:56 PM.


Sign In
Create Account


Back to top









