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.

alexdo
Site Moderator
Site Moderator badge
August 7, 2022

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

KFSys
Site Moderator
Site Moderator badge
August 7, 2022

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel