WalterItinOrient Posted July 30, 2009 Share Posted July 30, 2009 When I try "mysqli_connect" I get the error message that this function is undefined. My php.ini file is read, when I change something in it, it is reflected in the output from phpinfo(). Except that the "extension_dir" doesn't change, it keeps saying "C:\php5", whereas I changed that in my ini-file into "E:\php\ext". I also uncommented "extension = php_mysqli.dll" in the ini-file. I set PHPRC in my system variables to the right path. I have php 5.3 now and I am running it locally on IIS with Windows Vista SP1. Anyone got an idea? Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/ Share on other sites More sharing options...
wildteen88 Posted July 31, 2009 Share Posted July 31, 2009 When setting the extension_dir make sure there is no semi-colon ( ; ) infront of the line you're editing. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887709 Share on other sites More sharing options...
WalterItinOrient Posted July 31, 2009 Author Share Posted July 31, 2009 Yes, I uncommented 'extension_dir = "e:\php\ext" '. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887726 Share on other sites More sharing options...
roopurt18 Posted July 31, 2009 Share Posted July 31, 2009 I only bring this up because it's nailed me even when I thought I was correct. Which php.ini file does phpinfo() say it is loading? Not sure if it applies, but keep in mind the php.ini referenced by command line PHP and www PHP are not always the same. The fact that you say you edited php.ini and changed extension_dir seems to imply you got the wrong php.ini. The user account PHP (or web server) is running as doesn't have access to read the extension directory or some other such nonsense. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887808 Share on other sites More sharing options...
WalterItinOrient Posted July 31, 2009 Author Share Posted July 31, 2009 When I change something else in php.ini it shows up via phpinfo(), for example, when I change "display_errors = on " to ".... off" it is shown via phpinfo(). Phpinfo() shows "Configuration File (php.ini) Path: C:\Windows", but on the next line it says "Loaded Configuration File: E:\php\php.ini", the latter is correct. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887890 Share on other sites More sharing options...
roopurt18 Posted July 31, 2009 Share Posted July 31, 2009 Loaded Configuration File That's the file you want to be editing, which you are. Except that the "extension_dir" doesn't change, it keeps saying "C:\php5", whereas I changed that in my ini-file into "E:\php\ext". That doesn't make sense to me though. phpinfo() says the extension_dir is c:\php5? Lastly, whatever your extension directory really is, did you make sure the php_mysqli.dll is present and the proper version for your version of PHP? I know that some versions of the postgres dll I've had bundled with my installation have been faulty. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887898 Share on other sites More sharing options...
WalterItinOrient Posted July 31, 2009 Author Share Posted July 31, 2009 Question 1: Yes, my phpinfo() says the extension_dir is c:\php5. Question 2: php_mysqli.dll is present. I wouldn't know whether it is the proper version, I downloaded the whole bunch on June 28. Remark: I previously had a prior version of php5 which was indeed in c:\php5, but when I got 5.3.0. I put it on my E-disk because of space. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887949 Share on other sites More sharing options...
roopurt18 Posted July 31, 2009 Share Posted July 31, 2009 I'm not sure if this is relevant at all, but how did you install PHP the first time around? Did you just extract a zip file? Or did you run some .msi or .exe installation routine? Are you sure there aren't multiple extension_dir= lines in your php.ini? It makes no sense whatsoever that you can edit php.ini and have the changes take effect but that it ignores your extension_dir= change. Unless there's some other php configuration value that could affect it, such as safemode or something. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-887955 Share on other sites More sharing options...
WalterItinOrient Posted August 2, 2009 Author Share Posted August 2, 2009 I installed the package: php-5.3.0-Win32-VC9-x86.msi. There are no other 'extension_dir = ... ' lines in my php.ini. I tried to change the extension_dir in runtime: echo 'extension dir ' . ini_get('extension_dir'); ini_set('extension_dir', 'e:\php\ext'); echo 'extension dir ' . ini_get('extension_dir'); Nope! It remains at 'c:\php5'. Also I tried to put the 'php_mysqli.dll' in the place which the 'extension_dir' expects it, namely 'c:\php5' (I created that directory just for this file). No effect, whatsoever. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-888826 Share on other sites More sharing options...
PFMaBiSmAd Posted August 2, 2009 Share Posted August 2, 2009 You cannot set the extension_dir using an ini_set() statement. The .msi installer is bad news. It uses the Windows registry to hold settings and it expects you to use the Windows control panel add/remove (Vista Programs and Features) to manage extensions, which is why you did not find the expected extension .dll's in the folder (it puts them there on an as needed basis.) You either need to use the Windows control panel to enable extensions or you need to manually install php using the .zip package and hopefully if you use the control panel to remove what the .msi installer did it will remove the settings from the registry so that you will get back the control over them. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-888879 Share on other sites More sharing options...
roopurt18 Posted August 2, 2009 Share Posted August 2, 2009 I would just use Add / Remove programs to remove PHP altogether and use regedit to make sure it's gone. Then extract a .zip distribution and add the path to your environment variables. Then you'll have less problems most likely. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-888977 Share on other sites More sharing options...
WalterItinOrient Posted August 29, 2009 Author Share Posted August 29, 2009 OK. I uninstalled php, I downloaded the zip-package. Now nothing is functioning. Why the bloody hell can´t there be a sufficiently intelligent installation package. Or a manual that, on typing in Windows Vista, IIS, gives me help without having to sift out in every paragraph the things important to me? I want to program with PHP, not to try out installation variations hour after hour. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-908974 Share on other sites More sharing options...
roopurt18 Posted August 29, 2009 Share Posted August 29, 2009 Wherever you unzipped it to, just add that directory to your $PATH environment variable. You can access the $PATH variable by right clicking on My Computer -> Properties -> Advanced -> Environment Variables Just add c:\php; to the front of the existing value. Then if you open a command prompt (Start -> Run -> Cmd) you can type: php -v<enter> php -i<enter> php -m<enter> To see things about your installation. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-909051 Share on other sites More sharing options...
WalterItinOrient Posted September 2, 2009 Author Share Posted September 2, 2009 Well, come on now. It can´t be that simple. Php seems to be installed when I do that. The problem seems to be that IIS doesn´t see my php. 0x8007h007f is the error code,Calling GetProcAddress on ISAPI filter "C:\Windows\System32\inetsrv\isapi.dll" failed. The installation manual says that I should make a connection to "php5isapi.dll", which is nowhere to be found in the zip installation package. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-911212 Share on other sites More sharing options...
PFMaBiSmAd Posted September 2, 2009 Share Posted September 2, 2009 If you are using php5.3 - Warning Support for the ISAPI module has been dropped. Use the improved FastCGI SAPI module instead. Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-911217 Share on other sites More sharing options...
bobn Posted January 5, 2010 Share Posted January 5, 2010 I have the same problem with the php.ini extension_dir setting being overwritten. I tried uninstalling the .msi version and intstalling the zip version in C:\php531. phpinfo() shows other changes I make, but the extension_dir value is always changed back to "C:\php5". I don't really care if Windows wants to override the extension_dir setting as long as I can still load extensions. So added a C:\php5 directory, put it in the path variable and copied all of the C:php531\ext dll files there. I added the lines "[php_XSL]" followed by "extension=php_xsl.dll " as a test, expecting to see a listing for PHP_XSL appear in phpinfo(). There is no sign of the XSL extension, so guess it was not loaded. What should I try next? Thanks for any suggestions. Bob N Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-988572 Share on other sites More sharing options...
bobn Posted January 5, 2010 Share Posted January 5, 2010 found my problem If there is a syntax error in php.ini, then the directives that are below the syntax error seem to revert to default values. I found the problem by changing the seconds in the user_ini.cache_ttl directive and cutting and pasting the line to different places in the file until I found the line that was causing the trouble. I used a line of commented capital Xs along with the test line to make it easy to locate as I moved it around,. BobN Quote Link to comment https://forums.phpfreaks.com/topic/168193-extension_dir-doesnt-change-in-phpini/#findComment-989205 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.