LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   php.ini doesn't work (http://www.linuxquestions.org/questions/linux-server-73/php-ini-doesnt-work-4175410838/)

hahaso 06-11-2012 05: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 06: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 06:46 AM

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

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

and
Code:

# 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)
Code:

; Enable the PHP scripting language engine under Apache.
; http://php.net/engine
engine = On

Those, at least, must be there.

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

su -
<password>
apachectl stop

then run
Code:

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

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):
Code:

su -
password
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 10:23 AM.