• prototype2

    (@prototype2)


    It appear Phastpress is not compatible with Caddy web server?
    Nginx + WP 5.6.1 + PHP 7.4 are working fine in my test on Ubuntu Server 20.04.

    Will need your help to test and support it.

    • This topic was modified 4 years ago by prototype2.
Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    I’ve tested with Caddy, and it seems to work fine. What errors are you seeing exactly?

    This is my configuration:

    https://github.com/apeschar/wordpress-on-caddy-test

    –Albert

    Thread Starter prototype2

    (@prototype2)

    I have the tested and the problem with php-fpm. Does it work for you?

    :8080 {
    root * /var/www/html/wordpress
    php_fastcgi unix//run/php/php7.4-fpm.sock
    file_server
    }

    Thread Starter prototype2

    (@prototype2)

    I have assuming Caddy’s fcgi does not accept URL as parameter and redirect to the index URL address.

    Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    What do you see when you visit yourdomain.com/wp-config.php?

    What do you see when you visit yourdomain.com/wp-content/plugins/phastpress/phast.php?

    Normally, both should show you a blank (white) screen.

    –Albert

    Thread Starter prototype2

    (@prototype2)

    Return blank page which is correct
    https://domain/wp-config.php

    Return 404
    https://domain/wp-content/plugins/phastpress/phast.php

    It may look like some configuration issue with Caddy or WordPress for plugins folder?

    Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    Yeah, that sounds like it doesn’t have to do with PhastPress specifically, but Caddy just can’t reach PHP files inside your plugins folder.

    You could add a few files called test.php inside wp-content, wp-content/plugins and wp-content/plugins/phastpress, to see if you can reach those.

    –Albert

    Thread Starter prototype2

    (@prototype2)

    Added test.php to each folders, I can echo string on the web browser:
    wp-content/
    wp-content/plugins/
    wp-content/plugins/phastpress/

    I could even access readme.txt in this folder:
    wp-content/plugins/phastpress/readme.txt

    Then I have tried to replace phast.php with readme.txt and it still load readme.txt, not redirect to any page.
    https://192.168.64.5:8080/wp-content/plugins/phastpress/readme.txt?service=…

    I think I have manage to narrow down to phast.php itself?

    Thread Starter prototype2

    (@prototype2)

    For one more test, test.php echo string in my test correctly, not redirect to any page:
    https://192.168.64.5:8080/wp-content/plugins/phastpress/test.php?service=images…

    Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    Maybe it has something to do with the permissions or ownership on the file phast.php. Are they identical to your test.php?

    You could try copying phast.php to phast2.php, and seeing if that works.

    If it does, rename the old phast.php to phast.php.bak and then rename phast2.php to phast.php. Do you get the same 404 or does it work now?

    If it still doesn’t work, try deleting the .htaccess file in this folder. Although that shouldn’t make a difference since you’re using Caddy.

    –Albert

    Thread Starter prototype2

    (@prototype2)

    I don’t have .htaccess in any of WordPress subfolders including Phastpress.

    1) test.php
    Echo Hello string.

    2) Copy phast.php and paste as phast2.php, rename phast.php to phast.php.bak and rename phast2.php to phast.php
    Still error 404.

    3) phast3.php and test.php are identical.
    Copy phast.php source code, paste into the new phast3.php and access URL to that file directly.
    Still error 404, not blank page.

    4) Access URL directly to ../wp-content/plugins/phastpress/low-php-version.php
    Return code 200, blank plage.

    4) chmod 755 phast3.php and access URL to that file directly.
    Still error 404.

    5) Commented out code in phast.php
    // phastpress_get_service_sdk()->getServiceAPI()->serve();
    Shown blank page which is correct.

    It seem the sdk need to be debug.

    Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    Thanks for the details. I’m surprise you get a 404 error instead of something else. Are there any errors in your server log or wp-content/debug.log (if you have it enabled)?

    I’ve tested with Caddy myself and cannot reproduce the issue. But perhaps there is some difference in the setup. Could you share more info about your setup? The best thing would be if you could reproduce the problem using a Dockerfile or docker-compose setup. That would make it easy for me to test.

    –Albert

    Thread Starter prototype2

    (@prototype2)

    I can reproduce on VPS on Ubuntu Server 20.04.

    What PHP extension and other packages are require in your setup? I use the easiest steps and install the minimum PHP packages to get WordPress working and perhaps, might missed out some packages that need for PhastPress to work.

    Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    No additional PHP extensions are required beyond those used by WordPress.

    Can you share the exact steps that you’ve used to set up your VPS? I will attempt the same and see if I can get the same issue to happen.

    –Albert

    Thread Starter prototype2

    (@prototype2)

    Manage to trace down to this cgi.fix_pathinfo = 0 which I have added in php.ini, commented out is working now.

    Are there any way to get around when some users will add this cgi.fix_pathinfo when using Caddy?

    Plugin Author Albert Peschar

    (@kiboit)

    Hi @prototype2,

    I’m glad you’ve resolved the problem.

    When I test with Caddy and cgi.fix_pathinfo = 0, I get an error from PHP Access denied. when accessing any PHP file with additional parameters after the file name:

    /test.php/abc

    In any case, I’ve made a small change to the way the parameters are extracted from the URL when the server is not configured to pass PATH_INFO to the PHP script. This might resolve this kind of problem in similar situations.

    –Albert

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Work with Caddy web server?’ is closed to new replies.