How can I make my php.ini file recursive

The PHP settings defined in your php.ini file are not recursive. What this means is that they do not modify settings in any child folders (which are subdirectories of the current directory).

Let’s say you have a php.ini file in your public_html folder. That php.ini file has the PHP memory_limit set to 256M. Only scripts that run directly in your public_html folder will have the memory_limit set to 256M. If you have a folder named public_html/employees, that “team” folder will not be affected by the public_html/php.ini file, it would only be affected by a php.ini file located in its own folder, public_html/team

If you have many folders, creating a php.ini file for each folder would be quite tedious. What you can do is update your .htaccess file to tell the server that the public_html/php.ini file should apply not only to public_html, but to any folders within that folder (such as public_html/team or public_html/about-us).

 

 

 

Share This Post
Have your say!
0 0

Leave a Reply