1

I'm starting to learn php, but at the beginning I came across with an error which I don't know how to solve it. I have installed wampserver 2.4 in my windows 7. When I tried to execute a simple file containing only an echo, nothing appeared neither an error. What's the problem?

My code:

<?

echo "oi";

?>
6
  • 3
    Does your WampServer have short tags enabled? Commented May 14, 2014 at 11:08
  • I'd try <?php instead of the first <? Commented May 14, 2014 at 11:09
  • maybe short tags is disabled. try full code <?php and ?> Commented May 14, 2014 at 11:09
  • where have you put your file. you need to execute code via localhost like: localhost/foldername/filename.php Commented May 14, 2014 at 11:09
  • write your link and output of the browser Commented May 14, 2014 at 11:11

2 Answers 2

1

In php.ini file you have no permission to use short tag

change it

from short_open_tag = Off to short_open_tag = On

or use full tag

<?php //full php tag

echo "oi";

?>
Sign up to request clarification or add additional context in comments.

Comments

0

The problem probably is that short open tag is not on. Change it in php.ini In the php.ini file you have to change is make sure that will be like that:

short_open_tag = On

Also, try to use <?php instead <?

Also you can do it by wamp server, click on the wamp icon, go to PHP-> PHP Extensions -> open short tags

1 Comment

Your explanation was the best and was also the easiest to solve my problem, thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.