Jump to content
The Uniform Server Community
Sign in to follow this  
MarcusDavis

PHP_SAPI returning different values

Recommended Posts

Hi and thanks for reading.

 

I have UniserverZ XI working with php 5.5 perfectly for my requirements. Now I want to use a .bat file to perform a Cronjob within my system.

 

The script requires correct settings for PHP_SAPI like this:

 

...if(PHP_SAPI === "cli"...

When I perform echo(PHP_SAPI."\n"); in my script to check what kind of PHP_SAPI the server is using, I get different results:

 

cgi-fcgi when the script is run directly from the browser and "cli" when opened through a .bat file (cronjob).

 

anyway, executing the script with: php -f cron.php from the server console isn't performing the script, nor giving me an error.

 

my only success has been opening the script directly from the browser with PHP_SAPI set to cgi-fcgi.

 

How is this possible and how can I make it work from the bat file too?

 

Any help would be appreciated.
Thank you!

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...