mysql - php-cli error when using full path -
i'm using php 5.6 on ubuntu when run command php /var/www/html/export-sftp-bg.php get
php fatal error: uncaught exception 'exception' message 'file doesn't exist' in /var/www/html/inc/vendor/faisalman/simple-excel-php/src/simpleexcel/parser/baseparser.php:174 stack trace:
0 /var/www/html/inc/vendor/faisalman/simple-excel-php/src/simpleexcel/parser/csvparser.php(38): simpleexcel\parser\baseparser->isfileready(false)
1 /var/www/html/inc/functions.php(1448): simpleexcel\parser\csvparser->loadfile(false)
2 /var/www/html/export-sftp-bg.php(10): export_existing_campaign('yml=', object(simpleexcel\simpleexcel), object(notorm), '/var/www/html/e...')
3 {main} thrown in /var/www/html/inc/vendor/faisalman/simple-excel-php/src/simpleexcel/parser/baseparser.php on line 174
but i'm able run file using cd /var/www/html php export-sftp-bg.php
try this
sudo -u www-data php /var/www/html/export-sftp-bg.php
try run php apache user in ubuntu comand line.
change file permissions should run script root (not recommend) , or instead change file permissions:
sudo chown ubuntu:www-data file sudo chmod 664 file
and should same directory:
sudo chown ubuntu:www-data -r dir sudo chmod 775 -r dir
Comments
Post a Comment