-   Linux - Server (
-   -   php.ini doesn't work (

hahaso 06-11-2012 06:58 AM

php.ini doesn't work
Hi all,

Recently I configured a LAMP environment.

But I found the php.ini doesn't work. I checked the phpinfo(). The Configuration File (php.ini) Path is correct. But the php configure doesn't change even I delete the php.ini file.(I restarted apache thousands times, just nothing happend...):banghead:

PHP version: 5.4.3
apache version: 2.4.2

Could anyone help for this issue. THANKS VERY MUCH~

Ser Olmy 06-11-2012 07:35 AM

Does the path reported by php --ini match the location of your php.ini file?

Who is the owner of php.ini and what are the access rights?

tronayne 06-11-2012 07:46 AM

In your httpd.conf file do you have something similar to this:

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
<IfModule dir_module>
    DirectoryIndex index.html index.php


# Uncomment the following line to enable PHP:
Include /etc/httpd/mod_php.conf

Also, in your php.ini file (which is usually in /etc/httpd)

; Enable the PHP scripting language engine under Apache.
engine = On

Those, at least, must be there.

Also, make sure that you've actually stopped httpd. If you're using apachectl,

su -
apachectl stop

then run

ps -ef | grep hpptd
and there should be zero lines that look like these

root      2215    1  0 Apr06 ?        00:01:34 /usr/sbin/httpd -k start
apache    2571  2215  0 Apr06 ?        00:00:04 /usr/sbin/httpd -k start
apache  16667  2215  0 May19 ?        00:00:00 /usr/sbin/httpd -k start

If there are, you'll need to kill them by hand (or reboot the thing, but that's cheating):

su -
kill -9 2215 2275 16667

Somethings a restart will leave corpses running (not often, but it's been known to happen) and you need to make sure you're doing a clean start (no httpd processes running).

Hope this helps some.

All times are GMT -5. The time now is 03:56 PM.