• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP in CGI-BIN Outputs Source at first > sign

Consultant1027

New Pleskian
Have a php script. Runs fine from shell. From browser it out puts the source code starting at the first > character. Example:

echo '>will start outputting source code';

...some code...

The script is in cgi-bin/admin/reports

When I move the script to the httpdocs directory and run it from domain.com/script.php it works fine. I understand PLESK doesn't configure the domain so PHP will run under CGI. I've already got all my scripts there and would prefer to keep scripts (PERL or PHP) under the same directory tree. Plus I'm old school and feel uncomfortable putting any code in the document root, although I believe this is how most sites do it so I assume there is no security risk.

I suppose I just need to edit the VHOST.CONF but not sure what to add, been a LONG time since I messed with that file. Or should I just create and admin/reports dir in httpdocs and be done with it?
 
Last edited:
Back
Top