I’m trying to setup a web application that requires short_open_tag to be enabled in order to continue through the install wizard. I have set it to
short_open_tag=On
in php.ini, but it still shows off in phpinfo, adn the software wizard also sees it as disabled. I’m using PHP 7.0 and Apache2.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
In cases like this, usually there are a couple of stuff to check.
It seems like the changes to your
php.ini
file are not being recognized. Here are a few steps to troubleshoot this issue:Check if you are editing the correct
php.ini
file: You might have multiplephp.ini
files on your system. To make sure you are editing the correct one, create a simple PHP script with<?php phpinfo(); ?>
, run it in your browser and look for “Loaded Configuration File”. This is thephp.ini
file that is being used. Make sure to edit this file.Check for syntax errors: Make sure that the line you added doesn’t have any syntax errors and isn’t conflicting with any other lines. If there is a
short_open_tag
entry already, it might be overriding your entry. Also, ensure the line is not commented out (should not have a semi-colon;
at the beginning).Restart the Apache service: After making changes to the
php.ini
file, you need to restart the Apache service for the changes to take effect. You can do this by runningsudo systemctl restart apache2
orsudo service apache2 restart
, depending on your system.In your home directory, create a file called info.php.
In that file, put in the following: <?php phpinfo(); ?>
Then run it in your browser, look for “Loaded Configuration File”. It should give you a path like /etc/php5/apache2/php.ini. That’s the file you need to edit. Then restart apache.
If you use nginx you should restart fpm
not a nginx server. Maybe I will save someone time)