PHP file won't work in wordpress folder, but works in another virtual host

So basically I made a php file that is called with two arguments (order total and order number) and it spits out a png w

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
Add a comment  | 

1 Answer 1

Reset to default 0

Yes. 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

相关推荐

  • PHP file won't work in wordpress folder, but works in another virtual host

    So basically I made a php file that is called with two arguments (order total and order number) and it spits out a png w

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信