I can't seem to change some values in php.ini.
For example: display_errors = On
I can only turn it on on runtime.
I suspect that suhosin is messing with this, is there any way to bypass it?
Yes I'm sure I'm editing the right files, but look at this, taken from phpinfo():
Additional .ini files parsed /etc/php5/fpm/conf.d/pdo.ini, /etc/php5/fpm/conf.d/suhosin.ini
But I open suhosin.ini and there is nothing there, only extension=suhosin.so
Try adding this to your php.ini or suhosin.ini:
suhosin.disable.display_errors = Off
Related
I'm using the basic MAMP on Mac, and PHP doesn't display errors, I already changed PHP and Apache configuration but still, can someone help me?
Not an answer, but I can't comment yet. Its obvious and a stupid thing to do, but if anyone else has this issue there are lots of comments in the php.ini, make sure you are changing the actual variable definition and not just a comment!
First of all make sure that you are editing the right file. MAMP usually creates several php.ini files. Call phpinfo() and check the path to the correct php.ini.
In your php.ini you need to set the following:
display_errors = on
error_reporting = E_ALL
Don't forget to restart Apache after the changes.
I'm trying to turn off magic_quotes_gpc in PHP. I'm running PHP with Apache and Ubuntu.
I have in my config file (/etc/php5/apache2/php.ini):
magic_quotes_gpc Off
Where I create a page with phpinfo() it shows magic_quotes_gpc as on. I've also looked in Additional .ini files parsed and there is no setting for it.
Why is PHP ignoring this?
try to add/edit in php.ini
magic_quotes_gpc = Off
after adding restart your apache services for taking effect this
You can turn them off using .htaccess with:
php_flag magic_quotes_gpc Off
and also using php if writable php.ini
ini_set('magic_quotes_gpc' , 0 );
Firstly, it is deprecated so, don't rely on it. Mmmmmmmkay?
Secondly, Check
Loaded Configuration File
Under phpinfo()
Also Add :
php_flag magic_quotes_gpc Off to your .htaccess file.
Cool?
Did you recently make this change? If so, you have to restart PHP for it to take effect.
PHP configuration can be made in a number of different places:
php.ini
httpd.conf
.htaccess
within a php script via ini_set()
any more?
Some configuration settings can only be set in certain places and there's certain Apache and PHP settings that would prevent you from doing any PHP config changes in .htaccess or with your PHP script. But assuming that a given PHP setting can be set in all of the above places, in what order is this configuration read? In other words what overrides what? (I'm assuming that ini_set() overrides any of the previous settings).
There's compile-time settings before php.ini. The rest of the stages aren't really "configuration". They're more of a way to override settings established in a previous stage. PHP will quite happily run without any other config directives in php.ini/http.conf/.htaccess. php.ini does list (almost?) all the configuration settings available, but that's just a courtesy so you don't have to dig around in the docs to find the one setting you do want to override.
You named them in the correct order.
I don't recommend setting configuration in any other place than a php.ini though.
There are also per-directory php.ini configurations and I don't know which comes first, .htaccess or the directory php.ini but I would guess the .htaccess first and php.ini after.
Apache loads PHP, so Apache's config is read first. .htaccess is also handled by the webserver, so I'm guessing that will be second. Thirdly PHP is loaded. It checks for PHP.ini's in several locations. Also see here. Finally the ini_set is checked runtime.
First, You can use a user.ini file.
I think PHP will read it from the bigger to the smaller, I mean from httpd.conf -> php.ini (and then user.ini if set) -> .htacess -> ini_set()
What happens if php.ini is missing? Does PHP load with a default configuration? In phpinfo(), it says the configuration file path is /etc, however it also says Loaded Configuration File (none). I went into /etc, and noticed there is no php.ini, only php.ini.default. PHP is working though, so I'm guessing it must load with default settings. Can anybody confirm this for me?
PHP has what amounts to a php.ini compiled into it. The php.ini file on the system is there merely to override those pre-compiled defaults. If there's no php.ini, the compile-time values are in charge.
It does load default settings, yes.
if php.ini is missing , u can choose one of this files and rename it to php.ini => this will give u the same results
php.ini-development
php.ini-production
I wish this can help ;)
I need to turn allow_url_include On. How can I do this? I have access to .htaccess as well as php.ini.
I'm using PHP version 5.2.9
I've tried adding
php_value allow_url_include On
in .htaccess and
allow_url_include = On
in php.ini.
Both files are at the root of my website.
Is there a way to use the curl/get page function as a workaround?
Are you sure you're grabbing the right php.ini file?
If you're on a linux box, you might be grabbing the wrong one. I've seen that happen in the past. If you are indeed using Linux, open the terminal and type
which httpd
which php
Then you'll know if your pointing to the right locations.
Depending on what you are trying to use as a file to include you will need to enable both url_fopen and url_include.
The relevant php documentation entry is available here:
http://www.php.net/manual/en/filesystem.configuration.php