Work with Caddy web server?
-
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 5 years, 3 months ago by
prototype2.
-
This topic was modified 5 years, 3 months ago by
-
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
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
}I have assuming Caddy’s fcgi does not accept URL as parameter and redirect to the index URL address.
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
Return blank page which is correct
http://domain/wp-config.phpReturn 404
http://domain/wp-content/plugins/phastpress/phast.phpIt may look like some configuration issue with Caddy or WordPress for plugins folder?
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.phpinsidewp-content,wp-content/pluginsandwp-content/plugins/phastpress, to see if you can reach those.–Albert
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.txtThen I have tried to replace phast.php with readme.txt and it still load readme.txt, not redirect to any page.
http://192.168.64.5:8080/wp-content/plugins/phastpress/readme.txt?service=…I think I have manage to narrow down to phast.php itself?
For one more test, test.php echo string in my test correctly, not redirect to any page:
http://192.168.64.5:8080/wp-content/plugins/phastpress/test.php?service=images…Hi @prototype2,
Maybe it has something to do with the permissions or ownership on the file
phast.php. Are they identical to yourtest.php?You could try copying
phast.phptophast2.php, and seeing if that works.If it does, rename the old
phast.phptophast.php.bakand then renamephast2.phptophast.php. Do you get the same 404 or does it work now?If it still doesn’t work, try deleting the
.htaccessfile in this folder. Although that shouldn’t make a difference since you’re using Caddy.–Albert
I don’t have .htaccess in any of WordPress subfolders including Phastpress.
1) test.php
Echo Hello string.2) Copy
phast.phpand paste asphast2.php, renamephast.phptophast.php.bakand rename phast2.php tophast.php
Still error 404.3) phast3.php and test.php are identical.
Copy phast.php source code, paste into the newphast3.phpand 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.
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
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.
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
Manage to trace down to this
cgi.fix_pathinfo = 0which 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?
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 PHPAccess denied.when accessing any PHP file with additional parameters after the file name:/test.php/abcIn 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_INFOto the PHP script. This might resolve this kind of problem in similar situations.–Albert
The topic ‘Work with Caddy web server?’ is closed to new replies.