How to enable PHP to run with <? ?>

lkovnih226

New member
Joined
Dec 11, 2012
Messages
183
Points
0
I bought a script but the programmers makes php codes with <? ?>
I ran it on my hosting but it is showing error, I tried to add <?php ?> then it worked.
I uploaded to some different web hostings then some worked with <? ?> but some only <?php ?>

My question is how to enable PHP to run with <? ?>

thanks
 

elcidofaguy

Well-known member
Joined
Jan 13, 2015
Messages
1,281
Points
113
I bought a script but the programmers makes php codes with <? ?>
I ran it on my hosting but it is showing error, I tried to add <?php ?> then it worked.
I uploaded to some different web hostings then some worked with <? ?> but some only <?php ?>

My question is how to enable PHP to run with <? ?>

thanks
Easy to do with amending the short_open_tag in php.ini:

short_open_tag = on
 

ElixantTechnology

New member
Joined
Nov 26, 2014
Messages
622
Points
0
The mentioned tags have not been used since PHP Version 3/4 and should not be used generally. They used to be the norm, but they conflict with XML headers when running parsable XML files.

<? (which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option).

If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because PHP will start output buffering when there is no intention from the programmer to send any output at that point in the script.
 
Older threads
Replies
3
Views
3,848
Replies
9
Views
5,330
Replies
1
Views
3,188
jms
Replies
22
Views
9,231
Replies
8
Views
6,378
Newer threads
Latest threads
Replies
0
Views
590
Replies
2
Views
789
Recommended threads
Replies
1
Views
2,409
Replies
1
Views
644
Replies
1
Views
767
Replies
2
Views
2,455

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top