Saturday , February 29 2020
Trang chủ / Lập trình / PHP Allow short open tag

PHP Allow short open tag

PHP Not Accepting <? Tag; Only Accepting <?php and <script> Tag

Q. I’m using PHP along with latest version of Apache. Only <?php and <script> tags are recognized. Many of my scripts are broken. How do I allow the <? tag also?

A. You need to allow the <? tag by editing php.ini file. Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags.

Open php.ini ( /etc/php.ini or /usr/local/etc/php.ini), enter:

# vi php.ini

Set short_open_tag to On:

short_open_tag = On

Save and close the file. Restart webserver:

# service httpd restart


# /usr/local/etc/rc.d/apache22 restart

About admin

Check Also

Hướng dẫn sử dụng plugin PPO-Call-To-Actions

Chào mừng bạn đã quay trở lại blog Ngô Thắng! Hôm nay, bạn sẽ được học cách tối …

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Đăng Ký Nhận Tin Qua Email

Nhận thông tin bổ ích về WordPress, Hosting, Thủ thuật website, Download miễn phí....và các phần quà hấp dẫn qua email.

* là bắt buộc