Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Different shebang for server running as program and server running as a service?

Featured Replies

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.

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
pause

link_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
popd

Run 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.bat

All the best
Ric

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.