How to enable Short Open Tag in DevKinsta on Docker in Win10?

On Cloudways there is a simple switch to enable support for PHP Short Open Tags (a relic from older PHP code). You can also change the php.ini file to allow this manually by adding “short_open_tag=On” and restarting the server - but I cannot find the php.ini file to do this manually.

Where is the php.ini file in the DevKinsta files, using Docker Desktop on Windows 10 Pro?

Hi @kittenofd00m! Welcome to the Kinsta community!

Thank you for reaching out to us on the forum! There are a couple of ways to enable the short_open_tag directive in PHP in DevKinsta. One will enable it at the local level on a per site basis, and the other will enable it globally.

To enable this option on the local/site level you may open the DevKinsta window and select the site to navigate to the site info page. Once you are on the site info page you may select the “Site configurations” tab from the left side bar in the window (the icon will look like a wrench).

Once you are on the “Site configurations” page in the DevKinsta window please locate the “PHP.ini editor” section. In the text box below the default comment present you may enter short_open_tag = On; and select the “Save changes” button. This will then enable short_open_tag on the site.

If you would like to enable this option globally you will need to modify the php.ini file within the devkinsta_fpm Docker container.

To do this first open the Docker Desktop application and ensure you are on the “Containers” tab. From this page please select the devkinsta_fpm Docker container. This should take you to the Logs page for the container.

Above the log output window you will see tabs for the various functions to interact with the container. You will now select the “Files” tab and locate the php.ini file located under /etc/php/x.x/fpm/php.ini where x.x is the version of PHP your site is running.

Next, right click the php.ini file and choose to edit it. Within the editor that appears locate the short_open_tag option that is by default set to Off, and change it to read as On. Then, select the button to save the changes.

You will next switch to the “Exec” tab from the bar towards the top and run the command service phpx.x-fpm restart again x.x is the version of PHP your site is configured to use. This will restart the PHP-FPM service and enable the short_open_tag directive globally.

Please note however that in the event the devkinsta_fpm Docker container is updated or deleted and recreated for any reason this change will be reverted and these steps will need to be completed again to enable the short_open_tag directive globally.

Please let us know if this has helped or if you have any questions! We are standing by and happy to help!

Best regard