johnmerlino Posted August 3, 2011 Share Posted August 3, 2011 Hey all, So I was have common problem with date() function in php5.3. Someone said the error message suggests that your php.ini settings have 'EDT/-4.0/DST' set as your timezone setting and should rather be 'America/New_York' instead. Now i have two php.ini files: php.ini.default php.ini.default-5.2-previous. running phpinfo() just tells me that the php.ini is located in etc but doesn't mention which php.ini is in use. So to figure out which one, I run this: $inipath = php_ini_loaded_file(); if ($inipath) { echo 'Loaded php.ini: ' . $inipath; } else { echo 'A php.ini file is not loaded'; } And this outputs the else statement "not loaded". How could the php.ini not be loaded? thanks for response Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/ Share on other sites More sharing options...
requinix Posted August 3, 2011 Share Posted August 3, 2011 What exactly did phpinfo() say? Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1251454 Share on other sites More sharing options...
johnmerlino Posted August 3, 2011 Author Share Posted August 3, 2011 In terms of configuration it says this: Configuration File (php.ini) Path /etc Loaded Configuration File (none) It says none for loaded configuration file. If this is issue, how do I correct it? Thanks for response Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1251474 Share on other sites More sharing options...
requinix Posted August 3, 2011 Share Posted August 3, 2011 Is there an /etc/php.ini file? If not then you need to make one - use the php.ini.default as a reference/original. Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1251483 Share on other sites More sharing options...
johnmerlino Posted August 6, 2011 Author Share Posted August 6, 2011 Is there an /etc/php.ini file? If not then you need to make one - use the php.ini.default as a reference/original. Thanks for response, but from the unix shell, I did the following: cd ~ cd /etc/ ls php.ini.default hp.ini.default-5.2-previous So there was no php.ini per se. Hence, I did the following: mate php.ini.default sudo touch php.ini (copied content from php.ini.default into php.ini and then saved file) When I listed the /etc contents, the php.ini was now in there: php.ini php.ini.default php.ini.default-5.2-previous Yet, under Loaded Configuration File, it still says none. Platform is Mac OSX Thanks for response Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1253335 Share on other sites More sharing options...
requinix Posted August 8, 2011 Share Posted August 8, 2011 Did you restart the web server? From the shell does php -i show the php.ini being used? (php -i is the command-line version of calling phpinfo().) Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1254425 Share on other sites More sharing options...
johnmerlino Posted August 8, 2011 Author Share Posted August 8, 2011 Did you restart the web server? From the shell does php -i show the php.ini being used? (php -i is the command-line version of calling phpinfo().) thanks for response, now that I copied the file into the new php.ini. Suddenly php stops raising exception errors and rather I just get a "server error" from the browser. Was some configuration setting reset? Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1254610 Share on other sites More sharing options...
requinix Posted August 8, 2011 Share Posted August 8, 2011 Possibly. What do the server logs say about the error? Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1254617 Share on other sites More sharing options...
johnmerlino Posted August 19, 2011 Author Share Posted August 19, 2011 thanks for response, display_error was set to Off, so I turned it on. Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1259584 Share on other sites More sharing options...
requinix Posted August 19, 2011 Share Posted August 19, 2011 So has anything changed from before? See any error messages, either from PHP or in Apache's error logs? Quote Link to comment https://forums.phpfreaks.com/topic/243739-php_ini_loaded_file-says-phpini-not-loaded/#findComment-1259602 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.