Question

Can't restart apache2 - uploaded php.ini for Wordpress upload limit

I wanted to increase my Wordpress upload_max limit, changed the php.ini, but could not restart php.ini service or apache 2 service with any command including sudo nacho stuff, literally tried any forum about that, but could not fix

Guys help me


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello there,

To stop Apache, run:

  1. sudo systemctl stop apache2

To start Apache when it is stopped, run:

  1. sudo systemctl start apache2

To stop and then start the service again, run:

  1. sudo systemctl restart apache2

Apache can often reload without dropping connections if you are making configuration changes. To do this, use the following command:

  1. sudo systemctl reload apache2

When you’re making changes to the Apache configuration or doing restarts, it’s considered good practice to perform a config test to ensure the config files do not have misconfiguration that can trigger an error and cause downtime for your sites or applications.

Next, test for configuration errors:

sudo apache2ctl configtest You should receive the following output:

Output
. . .
Syntax OK

Restart Apache to implement your changes:

  1. sudo systemctl restart apache2

Regards

Hi @tamararesearch,

Changing the PHP settings in php.ini will need you to restart apache2 or nginx for the changes to take effect. Here is how you can do it:

  1. service apache2 restart
  2. service nginx restart

another way would be to use systemctl:

  1. systemctl restart apache2