MikeD Posted March 21, 2008 Share Posted March 21, 2008 Hello people, I've installed MySQL 5.0.51a-win32 and PHP 5.2.5 and Apache 2.0.63. In the phpinfo() page it says its looking for the php.ini file in C:\WINDOWS, when I put the file there and restart the server it doesn't work. I've got my php_mysqli.dll and libmysql.dll files in my php folder and I've added that to the file path and the extension=php_mysqli.dll has been commented out. I think I've done everything but its not working. Please can anyone help me out? Thanks. MikeD Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 21, 2008 Share Posted March 21, 2008 The "Configuration File (php.ini) Path" setting is the default location where php looks for the php.ini. The next line - "Loaded Configuration File" list the actual file if any, because there are several settings that can change the default location, such as the PHPIniDir statement in the Apache httpd.conf file. Quote Link to comment Share on other sites More sharing options...
MikeD Posted March 21, 2008 Author Share Posted March 21, 2008 The "Configuration File (php.ini) Path" setting is the default location where php looks for the php.ini. The next line - "Loaded Configuration File" list the actual file if any, because there are several settings that can change the default location, such as the PHPIniDir statement in the Apache httpd.conf file. Hi. The "Loaded Configuration File" section is "(none)". You mentioned the PHPIniDir statement in the Apache httpd.conf file-can you tell me what I have to alter exactly and where abouts in the http.conf file? Thanks. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 21, 2008 Share Posted March 21, 2008 Put something like the following at almost any place in httpd.conf (I put it directly after the LoadModule ... statement) - PHPIniDir "C:/php" Substitute the path to your php.ini Quote Link to comment Share on other sites More sharing options...
MikeD Posted March 22, 2008 Author Share Posted March 22, 2008 Put something like the following at almost any place in httpd.conf (I put it directly after the LoadModule ... statement) - PHPIniDir "C:/php" Substitute the path to your php.ini Did that and it hasn't worked. I've put my libmysql.dll and php_mysqli.dll in my system32 folder as well, re-started/stopped and started my server and still nothing happens. In the phpinfo() output it says its looking for php.ini in the C:\WINDOWS folder which is where I've put it but still nothing. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 22, 2008 Share Posted March 22, 2008 Start by checking your web server log file for errors. Stop and start your web server to get any changes made to httpd.conf or php.ini to take effect. Quote Link to comment Share on other sites More sharing options...
MikeD Posted March 22, 2008 Author Share Posted March 22, 2008 Start by checking your web server log file for errors. Stop and start your web server to get any changes made to httpd.conf or php.ini to take effect. The server error log just lists the shut down and start up processes. I've got everything in the right place-php.ini in C:\WINDOWS (as it says in phpinfo() output), the quotation taken off the mysqli extension in php.ini, the php_mysql.dll and libmysql.dll in php folder which is in the sytem path and the server is stopped and started/restarted all the time and yet there is no effect. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 22, 2008 Share Posted March 22, 2008 Unless the phpinfo() "Loaded Configuration File" line shows an actual loaded php.ini file, you are not going to get any php extensions to work. You have got to solve this part of the problem first. Either the httpd.conf you are changing is not the one Apache is using or something else is preventing php from reading the php.ini file, such as folder permissions or perhaps when you edited php.ini, it got saved with a .txt extension - php.ini.txt (if this last one turns out to be the case, thank you MS for thinking that file extensions should be hidden by default.) There are literally several dozen different things that could have been changed or errors that could be occurring and since we don't know what specific steps and changes you have made, where you got Apache/php from, what operating system..., nor do we have access to your computer, it is up to you to investigate what is going on, on your computer, and pin down what is or is not working. I recommend trying xampp from apachefriends - http://www.apachefriends.org/en/index.html Quote Link to comment Share on other sites More sharing options...
MikeD Posted March 22, 2008 Author Share Posted March 22, 2008 Unless the phpinfo() "Loaded Configuration File" line shows an actual loaded php.ini file, you are not going to get any php extensions to work. You have got to solve this part of the problem first. Either the httpd.conf you are changing is not the one Apache is using or something else is preventing php from reading the php.ini file, such as folder permissions or perhaps when you edited php.ini, it got saved with a .txt extension - php.ini.txt (if this last one turns out to be the case, thank you MS for thinking that file extensions should be hidden by default.) There are literally several dozen different things that could have been changed or errors that could be occurring and since we don't know what specific steps and changes you have made, where you got Apache/php from, what operating system..., nor do we have access to your computer, it is up to you to investigate what is going on, on your computer, and pin down what is or is not working. I recommend trying xampp from apachefriends - http://www.apachefriends.org/en/index.html OK I've got it load the php.ini file in the right place and it appears in the phpinfo() "Loaded Configuration File" line, however the section for mysqli doesn't show up in the phpinfo() bit. I've removed the comment from the extension and put the two dll files in the c:\php folder and its been added to the class path-all saved and server restarted-but no show...any thoughts on this? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 22, 2008 Share Posted March 22, 2008 In php.ini there is an extension_dir setting that points to where the extension dll's are located. It would typically have a value like - extension_dir = c:\php\ext This is where the php_mysql.dll and php_mysqli.dll are located. There are a couple of axillary dll's that the mysql extensions use that are already in the php root folder. If you have added the php root folder to your windows path statement (and restarted you computer), the extension_dir is set correctly, and the PHPIniDir setting is in the httpd.conf, there is no need to copy any files around to get any of the standard php extensions to work. I recommend stopping and starting the web server instead of just restarting it. Some of the setting are not incorporated on just a restart. Quote Link to comment Share on other sites More sharing options...
MikeD Posted March 23, 2008 Author Share Posted March 23, 2008 In php.ini there is an extension_dir setting that points to where the extension dll's are located. It would typically have a value like - extension_dir = c:\php\ext This is where the php_mysql.dll and php_mysqli.dll are located. There are a couple of axillary dll's that the mysql extensions use that are already in the php root folder. If you have added the php root folder to your windows path statement (and restarted you computer), the extension_dir is set correctly, and the PHPIniDir setting is in the httpd.conf, there is no need to copy any files around to get any of the standard php extensions to work. I recommend stopping and starting the web server instead of just restarting it. Some of the setting are not incorporated on just a restart. Hi and thanks for replying. OK, I've edited the php.ini file (which is in C:\WINDOWS) with extension_dir="c:\php\ext", I've put php_mysqli.dll in the ext folder (php_mysql.dll was already in there), the libmysql.dll file is in the php folder, in httpd.conf the PHPIniDir "c:\WINDOWS", I've saved and restarted the computer, stopped and started the server but still nothing. btw thanks to bearing with me on this...I really appreciate your time and efforts. Apologies if I'm annoying you in anyway. Thanks. MikeD Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 23, 2008 Share Posted March 23, 2008 If php is reading the php.ini and there are uncommented extension=.... lines for php_mysql.dll and php_mysqli.dll, then they should be loading or there should be related errors in the web server error log file. Where did you obtain the php Windows binary package and what type (.zip .msi) was it (every time I have seen someone attempt to use the .msi installer they have had problems getting it to work.) What operating system as well, because you could be having a basic permission problem with Vista? It is usually not difficult to add php to an Apache web server and to enable a language extension like mysql/mysqli. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 23, 2008 Share Posted March 23, 2008 A few notes on the Configuration File (php.ini) Path and Loaded Configuration File lines when running phpinfo(). If either of the those two lines do not end in php.ini then PHP is not reading the php.ini from the displayed location. This is where many people get very confused with where to place the php.ini If php cant find the php.ini then above lines will look like the following: Configuration File (php.ini) Path C:/WINDOWS Loaded Configuration File (none) The reason why the Configuration File (php.ini) Path line reads C:/WINDOWS is because that is usually the default location PHP tries to look for the php.ini If PHP is installed in C:\php and you have added C:\php to the System PATH Environment Variable (and not the User Environment Variable which is set in the same location) your php.ini should be in C:\php. In order for the new Environment Variables to work you must restart your computer. Also note that there is no need to move any files outside of the php folder either. If PHP is still not reading the php.ini then ensure the php.ini is the correct file type. As Windows hides the file extension from known file types it can obscure you from the real file extension of files. You maybe seeing php.ini as the file name from Windows Explorer but it may be named as php.ini.txt but Windows only shows the file as php.ini. You can tell this by looking at the file icon for the php.ini. It should have an image of a notepad which has an orange cog wheel on the right hand side of it and the words Configuration Settings underneath the filename in light grey (when viewed in Titled mode - Views > Tiles from Windows Explorer). If none of the above is true then there's your problem. Quote Link to comment Share on other sites More sharing options...
MikeD Posted March 23, 2008 Author Share Posted March 23, 2008 Hi people I've got it working now-Thank God! I was editing the wrong php.ini file-there are a few of them (don't know why). But anyway thanks for helping me out guys! MikeD 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.