php.ini changes not taking effect

I’m trying to change one or two of the php settings

I’ve set the directives in /etc/php5/apache2/php.ini and restarted apache but they’re not taking effect


From php.ini:

short_open_tag = On

From phpinfo:

short_open_tag Off Off

I even set the same values in /etc/php5/cli/ini.php

For some reason the changes to php.ini aren’t being recognised, could the values it’s actually picking up be stored somewhere else?

Or is it more likely that apache just isn’t ‘finding’ php.ini?

Are you doing this with root permissions?

Yes m8

It wouldn’t be allowing me to make changes to php.ini and save them if I wasn’t

Works fine here, I changed mine, viewed phpinfo, then changed back and viewed phpinfo. Everything as expected. Make sure you aren’t getting a cached page from the web browser, that you really have restarted the apache server, that you are not using some non-SUSE php5 module, and that you are looking at the right webserver.

Even when I viewed it from a browser on a completely different machine it doesn’t show the changes

I’ve completely rebooted the machine let alone restarted apache

It’s a fairly fresh suse 11 install and I’ve only ever installed apache/php/mysql into it through Yast

It’s definitely the right server

I did see something about environment variables during a google, but I’m not sure which ones I should have for changes to php.ini to work, or how to view and change them

Other things to check:

Check that you haven’t got multiple definitions for short_open_tag in php.ini or any of the included ini files in /etc/php5/conf.d. Presumably the last setting wins.

Also check that you haven’t overridden the setting in an Apache config file or .htaccess file using php_flag directives. See here: Custom PHP.ini tips and tricks

Thanks ken

I have to go out so I’ll check on those later

And of course make sure you have spelled the option correctly, maybe you missed a _. It may be stupid, but such things happen. I have done things like transposed digits in IP numbers and spent minutes wondering what the problem was.

Checked all of that m8, and as far as I can tell it’s none of those

Does it maybe rely on something being installed that perhaps I don’t have?

Nothing special required. This is an interesting case. I’m curious what it turns out to be. :slight_smile:

We’ll never find out I don’t think m8

Uninstalled php, deleted the ini files and reinstalled, it’s working ok now

Thanks for your help :slight_smile:

I think it’s the PHP deity’s way of hinting to you that you should not be using short_open_tag any more since it’s going away in PHP6. :slight_smile:

As well, no programers have been using short tags for years.
Short tags are for newbies and people just playing with PHP for a short time, that are never to return.

The usual reason PHP.ini is not reflecting a change made is because the .ini file is not seen.
Know where all your important files and environment vars are with your LAMP installation and you will not have these painful, silly errors.


The only reason I needed the short tags was trying a piece of web software that requires it

Maybe one day I’ll no longer be silly enough to expect the changes in ini files to take effect following a standard install through yast without any ‘exotic’ changes being made

Come that day life may be a lot less painful for me

You can limit the contagion of short_open_tags by enabling it only for the bad app in question by using the apache directive (shown in one of my posts above) that turns on that option only for a particular directory.

Thanks for that tip ken

I won’t be keeping the software in my local apache though, just taking a look at it for someone else, once I finish trying it I’ll probably be removing it and turning short tags back off


I have the same problem of you, the changes I did in php.ini doesn’t works.

Have you resolved your problem?



Apache must be restarted whenever php.ini is changed because the interpreter is a module loaded into Apache and reads the init file only once, on initialisation. There are two php.ini files, the other is for the CLI interpreter. Make sure you edit the right one.


Yes I did the changes into the 2 php.ini and reboot the server, but the changes doesn’t works.

I have the same problem for several setup, date.timezone and upload_max_filesize, I rebooted the server several time without succes.

phpinfo ignores php.ini settings, why?

It’s a big mystery


Maybe you are changing the wrong php.ini. On openSUSE it should be:


I also assume you are using the standard packages from openSUSE repos and didn’t go and install your own Apache and PHP.