aspendigital / docker-octobercms

Dockerized October CMS: PHP, Composer, October core and dependencies
MIT License
150 stars 54 forks source link

Getting "Page not found" when trying to run a php script #26

Closed gkurl closed 4 years ago

gkurl commented 4 years ago

Getting the following when trying to run a simple php script that sends a mail - even just a php script that echo's "hello" does not seem to work:

image

But if I place say a text file in that exact same directory you see in the URL and try and access it via the web browser I am able to download/view the file.

What could be wrong here?

petehalverson commented 4 years ago

October CMS blocks all PHP files, except index by default via .htaccess.

gkurl commented 4 years ago

Thanks for pointing me to that. Never knew. I have edited out and commented out that part in the .htaccess to test it out but am still seeing the page not found error...I have restarted the container multiple times so apache should be reset everytime although as far as I know I shouldn't have to with a .htaccess file...are there further steps involved specific to your image? I am using the :latest image. I also tried pointing it to a specific path using

RewriteCond %{REQUEST_FILENAME} !/path/.*

Also for some context - the php file I want to run is in my assets directory so my forms action looks like this:

{{'assets/mail.php' | theme}}

Any pointers?

gkurl commented 4 years ago

Ignore me - I've got it working :) turns out my .htaccess file was temporarily copied and the wrong one was being edited. Thanks a bunch for your help.