TCool Posted July 1, 2008 Share Posted July 1, 2008 Hi, I did some searching on the forums but couldn't find anything similar to my situation. I apologize if there is information already about this and I just missed it. Anyway, I recently downloaded apache 2.29, mysql 5.1.25 and php 5.2.6. I used the installer for all of the applications. I was able to get the php working with apache, and mysql support enabled. I verified that mysql was working by creating a database through the command line. The problem I'm having now is that I made a page to test to see if everything was working with mysql. The code looks like: <?php # Define MySQL Settings define("MYSQL_HOST", "localhost"); define("MYSQL_USER", "root"); define("MYSQL_PASS", "tim"); define("MYSQL_DB", "test"); $conn = mysql_connect("".MYSQL_HOST."", "".MYSQL_USER."", "".MYSQL_PASS."") or die(mysql_error()); mysql_select_db("".MYSQL_DB."",$conn) or die(mysql_error()); $sql = "SELECT * FROM test"; $res = mysql_query($sql); while ($field = mysql_fetch_array($res)) { $id = $field['id']; $name = $field['name']; echo 'ID: ' . $field['id'] . '<br />'; echo 'Name: ' . $field['name'] . '<br /><br />'; } ?> Now anytime I try to load that page I get an error from windows saying apache has to close, and then after this happens apache will not work at all no matter how many times I try to restart the service. I've gone through all the steps (as far as I know) to add the mysql extension to php, and properly configure all the files but nothing seems to work. I've reinstalled all the programs many times, but that isn't working either. Does anyone have any idea what is wrong here and how I can fix it? If you need any more information from me just let me know. Thanks in advance for your help! Tim Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 1, 2008 Share Posted July 1, 2008 Check the Apache error log for information about what might be happening and since this is affecting Windows, check the Windows event log too. Everyone who has used the the php .msi installer has had problems. I (and everyone else on this forum) recommend using the php .zip package. Quote Link to comment Share on other sites More sharing options...
TCool Posted July 1, 2008 Author Share Posted July 1, 2008 Thanks for the reply! As I went to bed last night I was thinking about it. I tried multiple times to install it using multiple different guides. One guide told me to put the libmysql.dll file in the system32 folder and another told me to put it into the windows folder. I'm guessing some how these were conflicting with one another because I forgot to delete it from the system32 folder after that attempt, but after I just deleted it today everything is working. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 1, 2008 Share Posted July 1, 2008 Try not to move any files outside of the PHP Installation folder. Keep all files that come with PHP within the installtion folder. You should add the PHP installation folder to the PATH Environment Variable instead. Moving files can cause problems when you go to upgrade PHP later on. upon uninstallation, PHP will not automatically remove files you have moved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.