• Resolved kjustice

    (@kjustice)


    I know this isn’t the plugin’s fault however I’m hoping you can give a little more insight as to how to fix this. I’m running on an nginx server. This error shows on the page:

    Execution of the PHP file from path “https://marylandland.com/wp-content/webpc-passthru.php” is blocked on your server, or access to this file is blocked. Add an exception and enable this file to be executed via HTTP request. To do this, check the security plugin settings (if you are using) or the security settings of your server.

    – I am not running any security plugins.

    – I tried setting security on the webpc-passthrr.php file to 777 (made no difference)

    – I added the recommended code to the nginx config. Mime types already existed in my server. This section is added and near the top (but nothing above should conflict)

    location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ {
    if ($http_accept !~* “image/webp”) {
    break;
    }
    add_header Vary Accept;
    expires 365d;
    try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404;
    }

    However that code above only affects the serving of webp images, not the execution of the php file.

    My nginx file does have this code that handles php:
    location ~ [^/]\.php(/|$) {
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    if (!-f $document_root$fastcgi_script_name) {
    return 404;
    }
    fastcgi_pass unix:/run/php/php7.4-fpm-marylandland.com.sock;
    fastcgi_index index.php;
    include /etc/nginx/fastcgi_params;
    }

    And I decided to add this to see if it would help:

    location /wp-content/webpc-passthru.php {
    fastcgi_pass unix:/run/php/php7.4-fpm-marylandland.com.sock;
    fastcgi_index index.php;
    include /etc/nginx/fastcgi_params;
    }

    When I run the url myself I don’t get an error but I don’t get any response either. I edited your file and included an echo(“hi”); as the last line and when I run the file, that’s what I get so in my opinion, the file can be run directly.

    Unfortunately none of these have resolved the error. I’m out of ideas. Can you offer any advice as to what to try next?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter kjustice

    (@kjustice)

    I just looked in your PassthruError.php file and noticed you are using curl in your function. I believe this is the issue as my server sits behind a firewall and reverse proxy. It cannot curl to itself.

    If I comment out the error checking for passthru, will the rest of the plugin function as intended or do you implement curl elsewhere?

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @kjustice,

    Thank you for your message.

    Errors detection is done to check if a plugin can work properly. Hiding the error is not the solution.

    Of course, you can do this at your own risk, but with each plugin update, you will lose these changes.

    I have the same problem as the user “kjustice” NGINX server.

    Unfortunately, I don’t have any ideas on how to tell it.

    Regards Krzysztof

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @ptrpartnerbhp the answer is the same.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error codes: passthru_execution’ is closed to new replies.