My name is Bong, James Bong
Gender:
Posts: 12
84 credits Members referred : 0
the path to wisdom begins with humble ignorance
« on: Jun 24, 2007, 06:50:53 pm »
Hi guys I've been running through some php tutorials trying to minimized the painfully annoying newbie questions I throw out... but alas I am stuck again on what I am sure is another easy one for you pros.
I am running PHP5 on apache 2.0.59 and mysql 5.0 which I configured manually I figured it would teach me a thing or 2 about the inner workings of the lot so much for that! ...once again i'm stuck.
I am trying to connect to mysql through php with this code:
$con = mysql_connect("localhost","root","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); }
and I get this error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\phppractice\msql_connect.php
this is on a machine running windows XP pro with SP2 PLEEEASE HELP!!!!
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #1 on: Jun 24, 2007, 07:49:38 pm »
In php 5 mysql is not enabled by default. Open the php.ini file and add this :
My name is Bong, James Bong
Gender:
Posts: 12
84 credits Members referred : 0
the path to wisdom begins with humble ignorance
« Reply #2 on: Jun 24, 2007, 08:49:19 pm »
I had figured that might be the problem and it was in the PHP.ini file already, I uncommented it and restart the apache server but I am still getting the error.
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #3 on: Jun 24, 2007, 09:55:03 pm »
thats nor true, mysql is a native lib in php 5 (at least the latest releases) try zend core:
thanks Olaf I installed zend core and I'm back in the game... and its really cool too!
great, I need to test this too (on a new machine)!
Quote
can anyone point me to some nice resources for php scripts I can download and practice with?
with Zend core you got the Zend framework, Check the related tutorials on zend.com (devzone), this way you will learn php5 (don't learn coding with php4) from the beginning and maybe you will push php5 on this forum too
Where are my glasses?
Posts: 21
138 credits Members referred : 0
« Reply #7 on: Jul 20, 2007, 01:36:49 am »
The MySQLi extension has a better performance than MySQL and is fully object oriented. If you're planning to use Windows for production use, I highly recommend not to use Apache. I had many problems with my Microsoft Windows 2003 server and Apache (Apache assigned too much RAM and didn't free up -> The used space became bigger and bigger and we couldn't access the server anymore. I read in some boards that I was not the only person having that problem. I think it's because of Winsock but I don't know for sure). Having switched to LightTPD I don't have any problems anymore and the pages are loadng much faster. Even big pages such as YouTube are using LightTPD. But the best way is to use Linux. On my Linux webserver I never have had problems with high RAM usage.
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #8 on: Jul 20, 2007, 08:42:28 am »
Tim,
this is interesting, I have a small webserver (for fetching thumbnails from websites) at home (a WAMP configuration) and YES I have a lot off errors. I though the errors are related to unclosed threads in apache.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #9 on: Jul 20, 2007, 10:28:09 am »
If you are using windows you need to be careful. You should close the connection or use a persistent one to make it work better. Of course if you are using linux everything would be better
If you are using windows you need to be careful. You should close the connection or use a persistent one to make it work better. Of course if you are using linux everything would be better
there is in windows no apache directive for preforc etc. or are you talking about mysql connections?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
Where are my glasses?
Posts: 21
138 credits Members referred : 0
« Reply #13 on: Jul 20, 2007, 02:16:04 pm »
Olaf, what sort of errors do you have? I didn't like the directory structure of Kevin Worthington's LightTPD installer. I made a batch file which is adapted to fit the needs. Here you can download it: http://rapidshare.com/files/43987523/install.tar.html
My name is Bong, James Bong
Gender:
Posts: 12
84 credits Members referred : 0
the path to wisdom begins with humble ignorance
« Reply #14 on: Jul 20, 2007, 03:14:18 pm »
one day I'll understand what you guys are talking about but until then... I'm still learning.
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
Olaf, what sort of errors do you have? I didn't like the directory structure of Kevin Worthington's LightTPD installer. I made a batch file which is adapted to fit the needs. Here you can download it: http://rapidshare.com/files/43987523/install.tar.html
do I need CGIWIN for this barch?
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
Olaf, what sort of errors do you have? I didn't like the directory structure of Kevin Worthington's LightTPD installer. I made a batch file which is adapted to fit the needs. Here you can download it: http://rapidshare.com/files/43987523/install.tar.html
do I need CGIWIN for this barch?
Yes, but it's already included within the installer.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6846