How can i restart apache?

I use ssh to upload my web application base on PHP. but when i upload new file as same name it still process on old one then I must restart server every time when I update my PHP file.

How can I config PHP or how to restart apache on shell commnad?

Thankyou.

PS. I use My Cloud EX2 ultra

Hello cosciisoft,

I would suggest you to contact WD support for more information on this concern.

Refer the link mentioned below for contact information.

Bad solution. My question is easy but you can’t support anymore. I suggest you shoud close this community if you can’t answer simple question like this.

1 Like

It is the apc module that is caching the php responses: https://www.php.net/manual/en/apc.configuration.php````

Make the following change to /etc/php/php.ini:

apc.enabled = 0

And then restart apache with the following command:

/usr/local/modules/script/apache restart web

This will disable the caching. Until the next restart of your NAS probably. Perhaps I should write an app for that, but until that has happened, this will have to do. :slight_smile:

A .htaccess file in the directory of the .php files works for me to prevent the caching of the php response.

.htaccess contents:
php_flag apc.cache_by_default 0

I have a MyCloud EX4100, with OS3.

UPDATE: The .htaccess file is not required for OS5, as the caching is no longer as issue.