I apologize ahead of time if this question is really basic. My background is in Windows and I am being asked to maintain a RedHat Linux server that is in bad shape and is in production use.
The issue is that the version of PHP is different when executed from a script in Apache vs. the command line.
For example:
From the command line:
From the web page (Apache):
From the a php script called by a web page:
The script is called by this php code and function:
$exec_result = sku_exec(CLIMPORT.FILE_NAV, '', $_POST['nav_skus']);
function sku_exec($file_path, $call, $args)
{
$exe = $file_path.' ';
if($call != '' && isset($call) && $call) $exe .= $call.' ';
$exe .= $args;
// echo $exe.'<hr />';
exec('php '.$exe, $return_data);
return $return_data;
}
I need to downgrade the script to use 5.2.9 instead of 5.4.1.
Where do I even start to look for how this is configured? Why would the version of PHP that Apache is using be different from the version that it is calling from a script?
I looked at Apache’s config file but did not see anything that jumped out at me.
Any suggestions?
Unfortunately, upgrading the server to the latest PHP is not an option at the moment. The plan is to build out a new server and migrate to it.
find / -name php
to see what different PHP binaries there are on the system. And if you know who wrote that bit of code, do us all a favour and beat them with a stick until they agree to change careers to flower arranging or something.