installed PHP 5.2.6 on windows (SBS2003) - command-line PHP not working

Having installed PHP5 I wanted to establish it works from CLI (as not working via IIS)
I have a simple script called test.php that contains the line:

echo "something";

when I run it from the windows command line, as per

> php -r test.php

it just returns a blank line !
Any ideas ?

CONFIG:
running SBS2003
I installed php-5.2.6-win32-installer.msi from the php\downloads site
This installed a seriously chunky php.ini file which I had to go through and remove any extensions that were causing >php to error

zorba111Asked:
Who is Participating?
 
obareeyConnect With a Mentor Commented:
-r option is for running code only. for example;

php -r echo(\"something\");

escape character used for windows not to take " as for command line.

you should use "php -f test.php" or just "php test.php"

php -h for more information
0
 
zorba111Author Commented:
sorry, I made a typo when I posted the original - the line actually was

> php -f test.php

it still takes about 3 secs to execute, and returns a blank line.

For reference I've attached the php.ini file I'm using

php.ini.txt
0
 
zorba111Author Commented:
OK, got this working

I basically went thru' the PHP.INI file and commented out any extensions I knew for sure I wouldn't be using. Managed to chop the number of loaded extensions down to about 20 (verified by running "php -m"), from a possible 120 that I inherited in the default PHP.INI file that came with the installation (of which I'd commented out about 20 to get to this post).

Either the 100 or so extensions I was loading made PHP too bloated to run (and maybe it hit some limit, set in PHP.INI - e.g. total memory size, and then fell over), or one of the extensions I was loading was dodgy, and the very loading caused a run-time error (but not a "linking" error, as it were).

I think whoever was responsible for the initial PHP.INI file in the latest windows install should take note, and provide something lightweight so ppl can be up and running - "less is more" as they say
:-)
0
 
zorba111Author Commented:
solved it myself, but thanks for responding
I think it would have taken someone else a long time to fix this, unless they read my PHP.INI file in detail, they wouldn't have known how many extensions I was loading !

thanks anyway
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.