« Back to all recent discussions

PHP problem with ZyXEL NSA325v2.

zawodowiec81zawodowiec81 Posts: 2  Junior Member
edited February 8 in Questions
I have a problem with PHP. When I uploaded new script to NAS web server  runs script correctly, but when I modified script and upload it to NAS, script runs like it was old version. My changes didn't work. Please help me. 

#NAS_February
Tagged:

Best Answer

  • rampage128rampage128 Posts: 1  Junior Member
    edited February 6 Accepted Answer
    Hi,
    you need to disable opcache.
    For that you have to connect to your NAS via SSH and edit the php.ini file:

    1. Enable SSH in your firmware/package settings.

    2. Connect to your NAS with putty, bash or whatever.

    3. The file is located in:
    /usr/local/zy-pkgs/php/php.ini

    You can edit it with vi
    vi /usr/local/zy-pkgs/php/php.ini


    4. Just change the line

    opcache.enable=1

    to

    opcache.enable=0


    5. Make sure that you restart your NAS or at least HTTPD.


    Good luck

Answers

  • zawodowiec81zawodowiec81 Posts: 2  Junior Member
    Great! Thank You!
  • casaticasati Posts: 5  Junior Member
    Forget step 4 from above!
    Better use this advice:

    opcache.revalidate_freq - Basically put, how often (in seconds) should the code cache expire and check if your code has changed. 0 means it checks your PHP code every single request (which adds lots of stat syscalls). Set it to 0 in your development environment. Production doesn't matter because of the next setting.

    opcache.validate_timestamps - When this is enabled, PHP will check the file timestamp per your opcache.revalidate_freq value.

    When it's disabled, opcache.revaliate_freq is ignored and PHP files are NEVER checked for updated code. So, if you modify your code, the changes won't actually run until you restart or reload PHP (you force a reload with kill -SIGUSR2).

    From: https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html

Sign In or Register to comment.