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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

obareeyCommented:
-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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.