1

Can I use my own file custom_php.ini, if I use Nginx?

Here is my Procfile:

web: vendor/bin/heroku-php-apache2 -i custom_php.ini
vendor/bin/heroku-php-nginx -C nginx_app.conf

custom_php.ini:

extension = /app/ext/siphash.so

nginx_app.conf:

location /news/space/ {
        proxy_pass http://nasa.gov/;
}

Thank you.

1 Answer 1

6

Yes you can.

Looks like your Procfile is malformed (assuming you copy/pasted correctly). It should read:

web: vendor/bin/heroku-php-nginx -i custom_php.ini -C nginx_app.conf 

It might be a good idea to copy the default php.ini (https://github.com/heroku/heroku-buildpack-php/blob/master/conf/php/php.ini) to custom_php.ini and add your customizations.

You can also quickly and easily re-define the document root like this (to folder public/ inside the app):

web: vendor/bin/heroku-php-nginx -i custom_php.ini -C nginx_app.conf public/

By the way, if you have PHP 5.5.11+ and Nginx installed locally, try composer require --dev "heroku/heroku-buildpack-php *" and then foreman start. That should boot a server on localhost, port 5000, using your Procfile and with all the same settings as on Heroku.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.