jeudi 8 juin 2017

[FIX] Why the "< ?" tag is not working on php ?

  Aucun commentaire

Heeey, Wassuuuuuuuuuup....

Today we will fix the "<?" tag problem in PHP.

If you are one of those that faced that problem, you probably didn't enabled the "short_open_tag" in your php.ini file by setting the value of the option "short_open_tag" to "On"

To fix the problem you should follow these step.
  1. Locate the php.ini file

    In order to enable the "short_open_tag" option, you must find the php.ini file in your server.
    If you know the location of php.ini file in your server, you an skip this step.
    To locate, create a new file (infos.php) in your html directory:
    nano infos.php
    And parse this line :
    <?php phpinfo(); ?>
    Open your navigator and go to your infos.php page :
    Now you can see the path of the php.ini file, for me it's : /etc/php5/fpm/php.ini
  2. Change the short_open_tag option

    Now as you are able to locate the php.ini file, you can open it with your preferred editor, I use "nano" .
    nano (your php.ini path)
    Then you will see the "short_open_tag = Off", fix the problem  by setting it to :
    short_open_tag = On
Note : You must restart your php service (apache or php-fpm) in order to apply changes.

That's it! hope it works for you 😉

Aucun commentaire :

Enregistrer un commentaire