Perl script cannot be executed and show 500 Internal Server Error

Created:

2017-05-16 00:40:01 UTC

Modified:

2017-08-16 17:25:19 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Perl script cannot be executed and show 500 Internal Server Error

Applicable to:

  • Plesk for Linux

Symptoms

Perl script script.pl located inside of /var/www/vhosts/example.com/httpdocs/cgi-bin/ directory cannot be executed produces and 500 Internal Server Error in browser.

The following errors can be found in suexec.log and domain's error log:

/var/log/apache2/suexec.log: 
[2017-05-15 22:59:05]: uid: (10000/johndoe) gid: (1003/1003) cmd: script.pl 
[2017-05-15 22:59:05]: target uid/gid (10000/1003 or 1002) mismatch with directory (10000/1003) or program (0/0)

/var/www/vhosts/system/example.com/logs/error_log
AH02811: script not found or unable to stat: /var/www/vhosts/example.com/cgi-bin

Cause

Incorrect permissions are set for /var/www/vhosts/example.com/httpdocs/cgi-bin/script.pl file

Resolution

Set correct permissions and ownership for the script:

# chown johndoe:psacln /var/www/vhosts/example.com/httpdocs/cgi-bin/test.pl
#
# ls -l /var/www/vhosts/example.com/httpdocs/cgi-bin/test.pl
-rwxr-xr-x 1 johndoe psacln 117 May 15 23:22 /var/www/vhosts/example.com/httpdocs/cgi-bin/test.pl

Where johndoe is a system user of the subscription

Have more questions? Submit a request
Please sign in to leave a comment.