PHP Help ()

I have this shell script

    #!/bin/sh

#############################################################
# Example startup script for the SecureTrading Xpay4 client #
# Install Xpay4 into /usr/local/xpay4                       #
# To run this script automatically at startup, place the    #
# following line at the end of the bootup script.           #
# eg. for RedHat linux: /etc/rc.d/rc.local                  #
#                                                           #
# /usr/local/xpay4/xpay4.sh                                 #
#############################################################

# Configuration options

# Path to java executable
JAVAPATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

########## Do not alter anything below this line ##########
echo "Starting Xpay4. Please ensure the Xpay4 client is not already running"
$JAVAPATH/java -jar /usr/local/xpay4/Xpay4.jar /usr/local/xpay4/xpay4.ini &

      

And I am trying to start it using

system("/x/sh/shell.sh");

      

I do this when a user navigates to a specific page on my site, however I only get a white blank screen, there is a way to check the error using system (), currently I am using

error_reporting(E_ALL | E_STRCIT)

      

and this applies to a wide range

+2


a source to share


4 answers


You can also try displaying the output from your script in case there is some problem with calling it from php:

system("/x/sh/shell.sh", $output); echo $output;



Hopefully this gives you a more interesting result.

0


a source


Is Safe Mode enabled? As the management says:

When safe mode is enabled, you can only execute files in the safe_mode_exec_dir. For practical reasons, it is currently not allowed to have .. components in the path to the executable.



You can check safe_mode with this script:

<?php
    $safe = ini_get("safe_mode");
    var_dump($safe);
?>

      

0


a source


may be

chmod +x /x/sh/shell.sh

      

and try

var_dump(system("/x/sh/shell.sh"));

      

system () returns false on error

0


a source


I found that when I get a blank page it is a typical syntax error. Run the php script from the command line with the -l (lowercase L) option, eg php -l myscript.php

. This will check your code for syntax errors. Then you can continue troubleshooting if needed.

0


a source







All Articles