• I am attempting a migration from Apache to NGINX. The site has been running on Apache for a couple of years now successfully. Have set up a clone of the working VM and have installed NGINX on it. (In case it impacts do have https enabled on the working environment). For now I am only using http (i.e. port 80) for my migration testing. (Oh – Apache has been disabled on the cloned VM used for NGINX)

    When I attempt to access the site, I am getting the following error:
    Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Error_Handler.php:83 Stack trace: #0 /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Error_Handler.php(83): fwrite() #1 /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Error_Handler.php(74): Sns_Error_Handler::log_error() #2 [internal function]: Sns_Error_Handler::app_error_handler() #3 /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Log.php(54): file_put_contents() #4 /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Log.php(23): Sns_Log::log() #5 /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Exception_Handler.php(130): Sns_Log::log_exception() #6 /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Exception_Handler.php(135): Sns_Exception_Handler::log() #7 [internal function]: Sns_Exception_Handler::exception_handler() #8 {main} thrown in /home/admin/www/wp-content/plugins/backup-wp/classes/Sns_Error_Handler.php on line 83

    The server block for the site is:

    server {
    
           server_name lp.fiattor.net;
    
           root /home/admin/www/;
           index index.php;
    
           location = /favicon.ico {
           log_not_found off;
           access_log off;
           }
    
           location = /robots.txt {
           allow all;
           log_not_found off;
           access_log off;
           }
    
           location / {
           try_files $uri $uri/ /index.php?args;
           }
    
           location ~ \.php$ {
    #       location ~ \.(php|phar)(/.*)?$ {
    #       fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$;
    
           fastcgi_intercept_errors on;
           fastcgi_index index.php;
           include fastcgi_params;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_param PATH_INFO $fastcgi_path_info;
           fastcgi_pass php-fpm;
           }
    
           location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
           expires max;
           log_not_found off;
           }
    
     }

    Oh – the hosting environment is Fedora 37 and NGINX 1.22.

    What am I missing?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I suspect it differs far more than just the web server. Probably also the PHP version. The error message comes from the plugin backup-wp, which is probably not compatible with it. Remove this plugin best by deleting it from the plugin directory.

    Thread Starter pdermott2306

    (@pdermott2306)

    Thanks Threadi for the suggestion. While is didn’t solve the problem completely, it did give a good direction to go in.

    I deleted the suggested plugin and attempted to access the web site. It gave me another error in a different module (wp-includes/class-wp-hook.php on line 287). Given that, I checked the Apache version of the web site and checked the plugins. On the Apache version, the “backup-wp” was listed but deactivated on the plugins page. There were also three other plugins in the same state (deactivated). So on the NGINX version I removed those other plugins as well and attempted to access the NGINX version.

    I am almost there now! The site does come up but the initial page “is not found” however the menu is there and I can navigate the web site and even return to the homepage successfully so now I just need to figure out why the homepage doesn’t display initially.

    Thanks again for pointing me in the right direction.

    • This reply was modified 2 years, 3 months ago by pdermott2306.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Migrating from Apache to NGINX’ is closed to new replies.