So basically I made a php file that is called with two arguments (order total and order number) and it spits out a png with an EPC QR Code (so people just scan it and their banking app fills in all the details).
This file works in an empty virtual host, but it won't work when I put it anywhere in a wordpress directory/virtual host.
Is there some setting somewhere that is keeping non-wordpress php files from executing?
So basically I made a php file that is called with two arguments (order total and order number) and it spits out a png with an EPC QR Code (so people just scan it and their banking app fills in all the details).
This file works in an empty virtual host, but it won't work when I put it anywhere in a wordpress directory/virtual host.
Is there some setting somewhere that is keeping non-wordpress php files from executing?
Share Improve this question asked Sep 1, 2019 at 8:27 Viktor GruberViktor Gruber 132 bronze badges 1- Welcome to WPSE. Don't forget to take the tour and check our help documentation. This is a great first question BTW. – Matthew Brown aka Lord Matt Commented Sep 2, 2019 at 1:03
1 Answer
Reset to default 0Yes. The default WordPress .htaccess file. Without edits, all calls are redirected to index.php
.
Your best bet is to pass the call through WordPress as a custom plugin. This answer deals with setting up a REST endpoint. Of course, that means returning JSON which might not be exactly what you are looking for.
Another approach might be to edit the .htaccess
file.
Something like this, near the top:
RewriteRule my-qr-code.php$ - [L]
This tells the server that in this case, if the file matches, we are done. That solution comes from a StackOverflow question.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745194109a4616006.html
评论列表(0条)