- October 28, 2019
- Posted by: Cheng
- Category: Uncategorized
It is not uncommon that you have to create/define a specified php.ini for a new website, if multiple websites are sharing the same dedicated server.
To do that, first you have to find which php.ini that your current website is loading, and then replace that php.ini with your own defined php.ini.
- Find the php.ini used by your existing website. To do that, we can create a php page, for example
with the following content
<?php phpinfo(); ?>
Then you can see the php detail of your website by visiting the page, i.e. https://unicoq.com/phpinfo.php. You will see something like /etc/php/7.0/php.ini, which is used by all the websites under the server.
2. Now, let’s copy the php.ini to your new website.
cp /etc/php/7.0/php.ini /var/www/html/unicoq.com/public_html/
You now can edit the php.ini to suit your needs. In this case, I am just going to remove uncommon max_input_vars, and update the number from 1000 to 3000.
3. Lastly, you will need to tell the server to load this new php.ini. To do that,
You then add the following code between the VirtualHost
4. In the end, make sure you restart the apache
sudo service apache2 restart