OpenShift PHP Image Asset Giving 500 Error

169 views Asked by At

I have deployed a PHP website do an OpenShift PHP 5.4 Cartridge. The application loads just fine, CSS, JS, etc. but images do not load correctly. The images exist in the git repo which is being pushed to OpenShift just fine but when I attempt to access an image, say from http://someopenshiftapp/images/logo.jpg it fails with a 500 error.

The server log gives me: /app-root/runtime/repo/images/.htaccess: Invalid command 'IndexIgnore', perhaps misspelled or defined by a module not included in the server configuration

I am trying to resolve this issue but so far google has not been able to help me. I tried editing the httpd.conf to include the module but that is a read only file. I may have to create a new cartridge from scratch? How do I serve images with OpenShift?

1

There are 1 answers

0
AudioBubble On BEST ANSWER

I don't know the exact reasons why Apache was behaving like this but it was. There was a robots.txt file disallowing all user agents in the image directory that another developer had added. This was causing the Apache installation to give a 500 error when attempting to access resources within the images sub-directory. If anyone has any further explanation I am willing to listen but for now this mystery is solved.

I may test this exact case in a stand alone Apache environment unrelated to OpenShift and attempt to reproduce this error. :) Happy Coding.