How to enable short_open_tag in RunCloud web application?
You may have heard of short_open_tag option in PHP, but it is a method to make your code shorter. It can be used to restrict the length of a text inside a tag. It helps us keep our code clean and neat. RunCloud allows you to use this feature without any trouble. To enable it, follow these steps. If you need to enable short open tag for a specific web application, simply follow the procedures below.
Step 1
To begin, we must determine whether or not the short open tag is already enabled; simply use the code below in a file to do so.
<?php phpinfo(); ?>
To view the PHP details of your web application, navigate to your website/filename.php. Please search for the term 'short_open_tag' to view the current status.
Step 2
After confirming that the short open tag is not enabled, we proceed to the second step. Please ssh into your server as root and run the command below.cd /etc/php-extra/
You must now locate the configuration for your individual web application, which will have the same name as your web application added with '.conf'. In my instance, it's app-doyle.conf, where app-doyle is the name of my web application.
We need to change this file, thus I'm running nano in this scenario.
nano app-doyle.conf
Copy and paste the line below into the file.
php_admin_value[short_open_tag] = On
We can now save the file by clicking 'ctrl' + 'x', it will ask if we want to save it, press 'y' and then 'enter' (saving to same file). Step 3
We have now modified the file, but to reflect this change, simply restart php-fpm as shown below.
service php74rc-fpm restart
Please keep in mind that the php version is dependent on the version of your website.
Recheck the website/filename.php and it should now say 'On'. We hope this guide was helpful and feel free to let us know what you think.
Comments
Post a Comment