Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lararocks's avatar

public folder downloads php file instead of rendering them

When I type mysitename.com/test.php it works perfectly with no issues. But when I type mysitename.com/public it downloads the php file instead of rendering it.

I just moved my site to another server and it supports php7 same as the old server.

Any idea guys? Thanks

0 likes
5 replies
lararocks's avatar

@JLRDW - It didn't work actually. The issue seems not to be with the index file.

Even this gives a 500 internal server error mysitename.com/public/temp.php

But mysitename.com/test.php still works

Even mysitename.com/temp/temp.php works

jlrdw's avatar
jlrdw
Best Answer
Level 75

If set up correct, public should give

404 Not Found

That public folder is, well read that guide.

jlrdw's avatar

Glad you got it. Just remember if set up wrong there can be security issues.

1 like

Please or to participate in this conversation.