Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Run Sqlldr from PHP exec - Command Not Found Error '127'

691263Dec 25 2012 — edited Dec 26 2012
Hello,

I am trying to run the sqlldr command from PHP, but I get an status of '127' (Command not found). What am I doing wrong?

<?php

shell_exec("ORACLE_HOME=/opt/nasapps/proprietary/oracle/product/current; export ORACLE_HOME");
$setpath = "PATH=$" . "ORACLE_HOME/bin:$" . "PATH; export PATH";
shell_exec($setpath);
$command = "sqlldr username/password@host/sid control=test_control.ctl > /dev/null; echo $?";
$xx = exec($command);
echo trim($xx); #outputs 127

?>

Thank you,
S

Comments

$ php54 -r "shell_exec('export MYTEST=something'); exec('env | grep MYTEST > /tmp/L.env');"
$ cat /tmp/L.env
$
The environment isn't set as you expect.

Try creating a shell script that sets the environment and runs the command, then call that script from PHP.
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 23 2013
Added on Dec 25 2012
1 comment
2,724 views