PHP 7.0 short_open_tag won't enable when changed in php.ini. Required to setup software I want to use.

Posted September 6, 2016 28.6k views

I’m trying to setup a web application that requires shortopentag to be enabled in order to continue through the install wizard. I have set it to


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.

  • might be a stupid question, but did you restart apache?

      sudo service apache2 restart
  • Not a stupid question at all. But yes, I did restart apache each time. I figured out that I was trying to change the value from a comment, and that much further down in the pnp.ini, the value was being set to off. So, though I was setting it to On, it was then being set back to Off.

    My bad, and thanks for the effort to help.

  • Another question… Which php.ini file did you modify and which operating system are you using?

    On Ubuntu for instance the proper file would be (i believe) /etc/php7.0/apache2/php.ini but if you have FPM or CLI versions of php installed as well there would be multiple php.ini files on your system.

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.

Submit an Answer
2 answers

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

sudo service php7.0-fpm restart

not a nginx server. Maybe I will save someone time)