Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I have to declare <?php

Tags:

php

I think that I've been used to a fairly liberal policy regarding the PHP declaration in projects - I've always just used:

<? // here is my php code ?>

I just setup an nginx server using PHP-FPM under FastCGI and now it requires me to declare explicitly:

<?php // here is my php code ?>

Is there any way to change that? (Since otherwise I would have to go into my project and find/replace all of the instances where this occurs).

like image 956
jpea Avatar asked Nov 19 '25 02:11

jpea


1 Answers

You need to enable short open tags via the php.ini configuration file. However, if you are using XML concurrently with PHP, there will be a conflict.

Just found a good article on the deprecation of short tags in PHP6.

like image 78
Evan Mulawski Avatar answered Nov 20 '25 16:11

Evan Mulawski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!