I'm trying to deploy an instance of Drupal with Cloud Foundry. Everything loads up and seems to start correctly, but when I try to hit the page I get the following error in the logs.

../.htaccess: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration

I'm using cloudfoundry/php-buildpack.

I was able to get the app to load the install page and run by commenting out this line in the .htaccess file.

Order allow,deny

However, I feel like this may cause security issues, and I really want a better fix to this issue.


2 Answers 2


PHP buildpack is currently using Apache HTTP Server 2.4. You see that error message because the Order directive has been deprecated in Apache HTTP Server 2.4.

You can either:

Update the configuration file for Apache HTTP Server 2.4

Instructions for migrating can be found on Upgrading to 2.4 from 2.2.

Enable the mod_access_compat module for Apache HTTP Server 2.4

This will allow you to keep using the older configuration style. To do this, you should copy this file from the build pack, place it in the root of your project directory under .bp-config/httpd/extra/httpd-modules.conf, and uncomment line #27. When you push, the build pack will detect all the enabled modules; include mod_access_compat from the configuration file and enable them.


The error is due to changes beetween Apache 2.2 and 2.4. 'Order' is deprecated. Solution is described here: https://systembash.com/apache-2-4-upgrade-and-the-invalid-command-order-error/

Not the answer you're looking for? Browse other questions tagged or ask your own question.