pr0fess0r
September 22nd, 2008, 11:12 PM
Hi :)
I have a command a I need to trigger from a PHP script - it uploads a file to a content distribution network using a command line utility called vxup.
I'm running Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.4 mod_perl/2.0.2 Perl/v5.8.8 on Ubuntu 7.10
I've given www-data permission to run this file as root in sudoers:
www-data ALL=(ALL) NOPASSWD: /usr/local/bin/vxup
The command I'm trying to run is
sudo /usr/local/bin/vxup add -c "/home/administrator/.xxx/yyy.pem" -K "8" "8.flv" "zzz" "/var/.kkk/8/8.flv"
So from PHP I'm calling it like this:
$output=shell_exec('sudo '.$vxup_path.' add -c "'.$vxup_certfile.'" -K "'.$id.'" "'.$name.'" "zzz" "'.$filename.'"');
If I run it I get an error in the Apache log:
An error occurred: basic_string::_S_construct NULL not valid
However if I run it from the shell like this:
sudo -u www-data /usr/local/bin/vxup add -c "/home/administrator/.xxx/yyy.pem" -K "8" "8.flv" "zzz" "/var/.kkk/8/8.flv"
It runs fine! Does anyone know what "basic_string::_S_construct NULL not valid" means and what might be going wrong?
Many thanks in advance
Lucas
I have a command a I need to trigger from a PHP script - it uploads a file to a content distribution network using a command line utility called vxup.
I'm running Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.4 mod_perl/2.0.2 Perl/v5.8.8 on Ubuntu 7.10
I've given www-data permission to run this file as root in sudoers:
www-data ALL=(ALL) NOPASSWD: /usr/local/bin/vxup
The command I'm trying to run is
sudo /usr/local/bin/vxup add -c "/home/administrator/.xxx/yyy.pem" -K "8" "8.flv" "zzz" "/var/.kkk/8/8.flv"
So from PHP I'm calling it like this:
$output=shell_exec('sudo '.$vxup_path.' add -c "'.$vxup_certfile.'" -K "'.$id.'" "'.$name.'" "zzz" "'.$filename.'"');
If I run it I get an error in the Apache log:
An error occurred: basic_string::_S_construct NULL not valid
However if I run it from the shell like this:
sudo -u www-data /usr/local/bin/vxup add -c "/home/administrator/.xxx/yyy.pem" -K "8" "8.flv" "zzz" "/var/.kkk/8/8.flv"
It runs fine! Does anyone know what "basic_string::_S_construct NULL not valid" means and what might be going wrong?
Many thanks in advance
Lucas