Welcome Guest, Not a member yet? Register   Sign In
CI from command line. $_SERVER['SCRIPT_NAME'] not populated.
#1

[eluser]srisa[/eluser]
Hello,

I am making use of the technique posted here to invoke some CodeIgniter scripts from the command line. In the controller which is being invoked I am using $_SERVER['SCRIPT_NAME'] to make sure that the calling script is indeed script for command line tasks.
On my local development environment (Win XP, php 5.2.0, apache 2.2.8) $_SERVER['SCRIPT_NAME' and $_SERVER['PHP_SELF'] are populated but on hosting environment (Linux Red hat 3.4.6, php 5.0.4, apache 1.3.33) $_SERVER['PHP_SELF'] is empty and $_SERVER['SCRIPT_NAME'] is not set. As per the comparison posted here $_SERVER['SCRIPT_NAME'] is set for apache. Why is this difference in the $_SERVER array?

I am planning to use $_SERVER[argv][0] to verify the calling script. Will that be okay?

Thank you.


Messages In This Thread
CI from command line. $_SERVER['SCRIPT_NAME'] not populated. - by El Forum - 01-07-2009, 05:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB