I need to create a wrapper script for PHP interpreter (already in PATH):
#!/bin/bash # This is a wrapper for the PHP interpreter. # # We prepare the enviroment for SQL Anywhere PHP extension sourcing # /opt/sqlanywhere17/bin64/sa_config.sh and then we call the PHP # interpreter already in the PATH passing -dextension=sqlanywere.so which # enable the PHP extension. # # Don't enable sqlanywhere.so globally becase for some reason this will # break the command "plesk bin php_handler". In addition the extension # requires the SQLANY17 environment variable which is hard to set with # CGI/FastCGI at this time. php $@
php-wrapper however is not working properly with quotes. For example, this works with the original interpreter:
php-r 'echo "Works";'
php-wrapper with the same arguments:
./php-wrapper -r 'echo "Works";'
PHP Parse error: syntax error, unexpected end of file in Command line code on line 1
How can I debug arguments
$@ to see what's happening and how can I solve this problem?