1

I am trying to run a php file in my web server in command line using

php test.php

But it is not working. it runs forever and takes 100% resources. It was working yesterday and now it is not working.

I tried to debug the process using

strace -p <pid>

and got lots of

times(NULL) = -2058427839

Can anyone help me to debug this? Rebooting and upgrading is my last resort. Please suggest a solution without reboot or upgrade.

4
  • 1
    The source code of your test.php would be quite interesting to look at. Commented Sep 29, 2011 at 7:21
  • php -v tells you something like PHP x.y.z (**cli**), not cgi or something like that? Commented Sep 29, 2011 at 7:22
  • you should also provide source code of that file to examine.. Commented Sep 29, 2011 at 7:23
  • I just used <?php echo "test"; ?>. Also I tried php -v. It is also taking long time and 100% cpu and not returning to prompt. I had to use ctrl-c to exit. Commented Sep 29, 2011 at 7:54

2 Answers 2

3

Try to run your php file in cli without the configuration file using the following command:

php -n <your-filename.php>

and then check whether its working?

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

1 Comment

Thank you Very much Ashok. When I run php without configuration file, it runs. There seems to be a problem in the extensions directory in php.ini. I changed the extensions directory and now everything is fine.
0

Place this into your test.php file to check that it is working and to see what is available.

phpinfo();

1 Comment

in this case there's no difference what WONT be echoed - php info or just 'test'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.