This forum is in archive mode. You will not be able to post new content.

Author Topic: Installing PHP 5.4.4 on Windows  (Read 1557 times)

0 Members and 1 Guest are viewing this topic.

Offline m0l0ko

  • Peasant
  • *
  • Posts: 129
  • Cookies: -4
    • View Profile
Installing PHP 5.4.4 on Windows
« on: July 04, 2012, 04:34:54 PM »
SOLVED: For some reason apache only processes PHP if it is wrapped in <?php ?> tags, it won't process PHP wrapped in <? ?> tags. Thats a first for me, usually <? ?> tags work fine.

I'm installing PHP and apache on a Windows machine at college but its been a long time since I've installed one of these servers on Windows (I switched to linux years ago, installing a LAMP server is much more straight forward than a WAMP). I followed the steps in the following tutorial:
http://www.reaper-x.com/2007/09/24/installing-and-setting-up-apache-22-series-with-php-5-on-windows/
but when I point apache to a PHP script, it filters out the <? ?> tags but it doesn't process the PHP at all. For example, if the .php file contains <? echo "String1"; ?><p>String2</p>, it will only print String2. In older versions of PHP5, there was a php.ini-recommended file which I used as php.ini but now there is only php.ini-development and php.ini-production. Which one should I use?

EDIT: I should mention that PHP works when I run it from the command line (c:\php\php-cgi test.php), it just won't work when I point the browser to it (localhost/test.php). The problem must be with how the apache server is configured.
« Last Edit: July 04, 2012, 06:03:44 PM by m0l0ko »

Offline ca0s

  • VIP
  • Sir
  • *
  • Posts: 432
  • Cookies: 53
    • View Profile
    • ka0labs #
Re: Installing PHP 5.4.4 on Windows
« Reply #1 on: July 04, 2012, 06:26:55 PM »
SOLVED: For some reason apache only processes PHP if it is wrapped in <?php ?> tags, it won't process PHP wrapped in <? ?> tags. Thats a first for me, usually <? ?> tags work fine.
That is configurable in php.ini
http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
Code: [Select]
short_open_tag = 1

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Installing PHP 5.4.4 on Windows
« Reply #2 on: July 04, 2012, 06:45:24 PM »
Using short tags is a bad habit, use full <?php ?> tags.
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.