The loaded configuration file path is /usr/local/lib/php.ini (found using phpinfo();).
How can I edit this file or making a copy of this file anywhere I wish? In some forums I was asked to execute this command,
cp /usr/local/lib/php.ini /public_html so that the PHP.ini file will be copied to public_html folder. But I do not understand where to execute this command.
I do not have much idea in PHP, so that I could resolve this issue on my own. What is the detailed procedure to do this?
If you have access to your own dedicated server or virtual machine:
Open up the terminal, type
sudo nano /usr/local/lib/php.ini,make the required changes, hit Ctrl + O to save, and then Ctrl + X to exit.
If you want to copy to somewhere else, use
cp /usr/local/lib/php.ini /path/to/new/locationIf you are using a shared hosting provider
You can not modify the php.ini file or use another version. You will need to override the settings in the
.htaccessfile or a PHP runtime. Please note that your shared host may have these settings disabled, so you can’t hog the shared server’s RAM.File .htaccess example
Runtime example (at the very top of the PHP script)