fixed permission issue by running it as user www-data

This commit is contained in:
randyjc 2023-07-11 09:19:43 +00:00
parent dcbc4d9408
commit e3c0a81f22
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,7 @@ log_error() {
# Run the PHP command
log_message "Running PHP command..."
php /app/code/artisan lychee:sync /app/code/public/uploads/import/ >> "$LOG_FILE" 2>&1
sudo -E -u www-data php /app/code/artisan lychee:sync /app/code/public/uploads/import/ >> "$LOG_FILE" 2>&1
php_exit_code=$?
# Check if the PHP command succeeded
@ -34,3 +34,6 @@ if [ $php_exit_code -eq 0 ]; then
else
log_error "Error executing PHP command. Exit code: $php_exit_code"
fi
# Exit the script
exit 0