Reputation: 19119
While using the built-in PHP web server, how do you set configuration options, typically set using php.ini
or a .htaccess
file?
Upvotes: 8
Views: 4589
Reputation: 19119
Simply add a custom configuration file to your project, and then run the built-in server with this flag:
php -S localhost:8000 -c php.ini
This is especially helpful for settings that cannot be set at runtime using ini_set()
.
php.ini
file:short_open_tag=On
You can also forgo the php.ini
file and add your configuration inline:
php -S localhost:8000 -c "short_open_tag=On" -t public/ server.php
Upvotes: 18