sacoman Posted December 16, 2014 Report Share Posted December 16, 2014 Platform: Windows, UniserverZ 11, ActivePerl. I use several directories for cgi. In each of them there is a .htaccess file with two lines: Options +ExecCGI and AddHandler cgi-script .pl .cgi .exe. The Perl programs start with #!perl. Starting the server with UniController.exe, Perl programs run properly. Starting the server as a service using UniService.exe, I get error 500. For error 500, the Apache log reports /dir1/dir2/.../someprogram.pl was not found. Running as service I can solve the problem using absolute address for perl.exe, for example, #!C:/UniServerZ/core/perl/bin/perl.exe. I'm thinking of the possibilities: [1] This is a bug of the service or [2] That's right, but I have not found documentation about or [3] I'm missing something. Thank you for the answers. Quote Link to comment Share on other sites More sharing options...
Ric Posted December 17, 2014 Report Share Posted December 17, 2014 Your solution "I can solve the problem using absolute" is correct! It is a requirement for Window XP.However I noticed you are using Windows 7 there is a more elegant solution that allows you to use the Unix shebang "#!/usr/bin/perl" when running the servers either as a standard program or service. Create two new files (link_create.bat and link_delete.bat) in folder UniServerZ with the following content:link_create.bat rem working directory current folder pushd %~dp0 rem save us path set us_path=%cd% rem change to top level cd \ rem create link mklink /D usr %us_path%\core\perl rem restore original popd pauselink_delete.bat rem working directory current folder pushd %~dp0 rem save us path set us_path=%cd% rem change to top level cd \ rem delete link rd usr rem restore original popdRun link_create.bat (right click on file link_create.bat and run as administrator) allow program to make changes. This creates a symbolic link to the Perl executable.Start UniController. From the Perl tab run "Force Unix Shebang" you only need to perform this once.From UniController start Apache and check your Perl scripts run.Close Apache and UniController.Start UniService install and run Apache. Again check your Perl scripts run.Note: To remove the link double click on file link_delete.batAll the bestRic Quote Link to comment Share on other sites More sharing options...
sacoman Posted December 17, 2014 Author Report Share Posted December 17, 2014 Ric. Thank you very much for the answer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.