Problem in php settings - <? does not execute

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Problem in php settings - <? does not execute

Post by Sindarin »

There is a problem with a client's hosting provider which I am on. They have setup a server, installed php but some settings they have used stop my scripts from executing.

When I do

<? echo("test"); ?> does not work, it prints the source code in html

but

<?php echo("test"); ?> works.

Does anyone know what setting they need to change in their php.ini?
They are using PHP Version 5.2.6 and Windows.

I also noticed expose_php in the ini is On.
User avatar
Ziq
Forum Contributor
Posts: 194
Joined: Mon Aug 25, 2008 12:43 am
Location: Russia, Voronezh

Re: Problem in php settings - <? does not execute

Post by Ziq »

You should change short_open_tag to On

Code: Select all

 
short_open_tag = On
 
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: Problem in php settings - <? does not execute

Post by Sindarin »

Thanks it works now.

The most awesome thing is that I was bashed by their provider that I should know this. :|
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Problem in php settings - <? does not execute

Post by Syntac »

You should not use the <? tag. Ever.
mmj
Forum Contributor
Posts: 118
Joined: Fri Oct 31, 2008 4:00 pm

Re: Problem in php settings - <? does not execute

Post by mmj »

Syntac wrote:You should not use the <? tag. Ever.
:yar:
Agreed.

Agreed.

Did I already say that I agree?

Agreed.
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: Problem in php settings - <? does not execute

Post by Sindarin »

I don't that much, but there are times that a <? or two slip right off the eye.
Post Reply