I heard when you want to change the php.ini settings when you don't have access to the php.ini in the root level that you can upload a php.ini to the web-root, is this correct ?
Another way to customize your PHP settings is to create a file named
php.ini
and to upload it to your web server. This works in a way similar to the.htaccess
file except you don’t have to add “php_value” at the beginning of the line
if this correct that means anyone who type
www.xx.com/php.ini
should see the settings ? isnt this a security risk ?
It is where you declare changes to your PHP settings. The server is already configured with standard settings for PHP, which your site will use by default. Unless you need to change one or more settings, there is no need to create or modify a php. ini file.
The php. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits.
The php. ini file is the standard configuration file in PHP-based applications. It is used to set upload sizes, display errors, resource limits, file timeouts, and many other things to manage the Apache server. You already have default PHP settings installed on your server. There's no need to create or edit a php.
It's safe from people editing it. However it is visible to anyone who stumbles across your php.ini, so it's better to use .htaccess to disallow people from seeing it so readily.
I'd stick to using ini_set instead of putting a php.ini file up there.
But if you had to, you had better secure it with the right set of .htaccess
rules.
Something like
<Files php.ini>
Order allow,deny
Deny from all
</Files>
The above rule will prevent anyone accessing that file as www.xx.com/php.ini
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With