简体   繁体   中英

Overriding global php.ini file

I don't have access to global php.ini file since I am running my application on shared hosting and now what happens is I need to put my php.ini file in every directory to use the settings. But I am wondering whether there is a way to override the global php.ini file in my root directory for every sub folders instead of putting the php.ini file inside of every and each folder which isn't a good practice for further times.

If you are asking which specific option I need to change is auto_prepend_file

Yes! Not all php.ini options can be set, but many can be changed through .htaccess files, or the ini_set function, etc. See these pages .

For CGI/FastCGI use .user.ini files Docs . Works since PHP 5.3.

Some shared hosters allow as well to place php.ini files into the webroot directory or at some other place. Contact your hoster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM