On my development machine, I am using XAMPP 1.8.1
with
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
for testing projects. However, I have encountered an issue where I am unable to select Polish as a language option in both my personal project and the popular Bootstrap Datepicker component.
Upon investigation, I discovered that this problem arises when the browser attempts to load the locale file (general.pl.json
for my project and bootstrap-datepicker.pl.js
for the Bootstrap Datepicker), resulting in a 500 Internal Server Error
from Apache.
After reviewing the Apache error.log
, it appears that Apache is mistakenly trying to execute these files as scripts (possibly Perl):
[win32:error] [pid 5128:tid 1680] [client 127.0.0.1:53455] AH02102: C:/XAMPP/htdocs/mobile/public/pg-demo-bootstrap/locales/general.pl.json is not executable; ensure interpreted scripts have "#!" or "'!" first line, referer: http://127.0.0.1/mobile/public/pg-demo-bootstrap/
[cgi:error] [pid 5128:tid 1680] (9)Bad file descriptor: [client 127.0.0.1:53455] AH01222: don't know how to spawn child process: C:/XAMPP/htdocs/mobile/public/pg-demo-bootstrap/locales/general.pl.json, referer: http://127.0.0.1/mobile/public/pg-demo-bootstrap/
[win32:error] [pid 5128:tid 1644] [client 127.0.0.1:53465] AH02102: C:/XAMPP/htdocs/us/ustv/assets/6dafd2fe/js/locales/bootstrap-datepicker.pl.js is not executable; ensure interpreted scripts have "#!" or "'!" first line, referer: http://127.0.0.1/us/ustv/content/manage/update.html?id=4
[cgi:error] [pid 5128:tid 1644] (9)Bad file descriptor: [client 127.0.0.1:53465] AH01222: don't know how to spawn child process: C:/XAMPP/htdocs/us/ustv/assets/6dafd2fe/js/locales/bootstrap-datepicker.pl.js, referer: http://127.0.0.1/us/ustv/content/manage/update.html?id=4
Despite numerous tests with different content and filenames, the issue persisted only with the presence of .pl
in the filename.
Some key questions to address:
Why does Apache identify these files as scripts despite having
.pl
in the middle of a filename ending with.js
or.json
?Why is Apache on Windows attempting to run Linux/Unix/Bash scripts and expecting characters like
#!
or'!
at the beginning of the script?
An important question remains—how can this be resolved so that Apache recognizes these files as simple JavaScript files rather than attempting to execute them?