Running SC-gnerated PHP Script from Windows Command Prompt

I have a very very long running blank app which always gives me a 500 internal error message after processing about 3000 records. So each time I run it I have to modify the code to begin from the last processed record. This is despite setting ini_set(‘max_execution_time’ ,0); at the start of the app and also increasing some other timeout settings in the ini.

I am now trying to call this from dos prompt with:

 php myscript.php

but this gives the error

 [B][SIZE=4]Common libs not found:[/SIZE] C:/xampp/htdocs/myproject/myscript/_lib/prod [/B]

It seems to be searching for _lib inside the app folder. How can I make this work (it should pick up prod folder from the right location which is under myproject.

When I run (from myproject folder):

 php myscript\myscript.php

I get the following:

Warning: include_once(…/myscript/index.php): failed to open stream: No such file or directory in C:\xampp\htdocs\myproject\myscript\myscript.php on line 2

Warning: include_once(): Failed opening ‘…/myscript/index.php’ for inclusion (include_path=’.;C:\php\pear’) in C:\xampp\htdocs\myproject\myscript\myscript.php on line 2

No worries…curl seems to solve the problem.

Just FYI… this is not really the full answer. You are right curl lets it run correctly since curl is just like a user with a web browser running your code. The only unfortunate side effect of this is that for my instance its still only running the code via the web server. So I am unable to check for the existence of the code running.

If that doesn’t make sense let me explain it another way. It would seem that Scriptcase is dependent on certain apache modules and libraries that don’t exist if you run the code directly from the command line. PHP, while designed primarily for web use, can be run from the command line do perform tasks, etc… but it would seem since Scriptcase is dependent on these other libraries etc, there is no way to run a Scriptcase generated application from the command line directly.

At least I haven’t figured out a way to.

Check your apache logs you should see the reason for the error in there.