Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-11-2012, 05:58 AM   #1
LQ Newbie
Registered: Nov 2011
Posts: 4

Rep: Reputation: Disabled
Question 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...)

PHP version: 5.4.3
apache version: 2.4.2

Could anyone help for this issue. THANKS VERY MUCH~
Old 06-11-2012, 06:35 AM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 2,485

Rep: Reputation: Disabled
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?
Old 06-11-2012, 06:46 AM   #3
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
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.


apache, php5, phpini

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] php.ini.rpmsave instead of php.ini ilvista Linux - Server 3 02-01-2011 04:39 PM
PHP won't recognize my Configuration File (php.ini) path kriezo Programming 4 02-14-2008 02:31 AM
php.ini-dist to php.ini lord-fu Programming 10 05-02-2006 05:24 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
Apache doesn't start first try after tweaking php.ini JBR Linux - Software 1 02-02-2005 07:12 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration