PHP extension 'MapScript' only runs in Apache DSO

Bug #130304 reported by SteveM@SML
4
Affects Status Importance Assigned to Milestone
mapserver (Baltix)
New
Undecided
Unassigned
mapserver (Debian)
Fix Released
Undecided
Unassigned
mapserver (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: php5-mapscript

The PHP5 MapScript extension (from the UMN MapServer project) does not work when PHP5 is running in either CGI/FCGI or CLI modes. For example, when trying to use the MapScript extension in a PHP5 script run from the command line, the following error message is emitted:

"This build of mapscript can't be load as a 'cli' module for stability reason, but only with php as an apache DSO."

I have examined the package source, and I have isolated the cause of this bug. There is a specific patch in the Debian build source for package 'php5-mapscript' that inserts a check in the startup code for the PHP/MapScript extension. The inserted code checks the sapi_module name, and if it is 'cli', 'cgi', or 'cgi-fcgi', the extension emits the above error message, and exits.

Specifically, the patch is: mapserver-${version}/debian/patches/20_php_build.dpatch
(As I write this, ${version} == "4.10.2".)

Whatever the reason for forbidding the use of the PHP/MapScript extension in CGI/FCGI or CLI modes, I believe that it is no longer valid. In fact, the MapServer documentation recommends running PHP/MapScript in CGI mode, in preference to DSO.

See: http://mapserver.gis.umn.edu/docs/howto/phpmapscript-install
Specifically, this FAQ appears there:
Q: Does PHP/Mapscript have to be setup as a CGI? If so, why?
A: Yes, please see the [link]PHP/Mapscript CGI page[/link] in the Mapserver Wiki for details.

I feel that the simplest and best remedy for this bug is to remove the above patch ('20_php_build.dpatch') from the package build source. Furthermore, the package comments or notes ideally should mention that PHP/MapScript is recommended to be run in PHP as CGI, and possibly even warn users that there could be instability issues when run in DSO mode.

Tags: patch
Revision history for this message
SteveM@SML (stevem-spatialmapping-com) wrote :

For convenience, I have attached a copy of '20_php_build.dpatch' from the 'debian/patches' directory of the 'mapserver' package. As mentioned in my bug report, I am requesting that this patch be removed from the package source.

Revision history for this message
SteveM@SML (stevem-spatialmapping-com) wrote :

I have submitted this bug upstream to the Debian MapServer package maintainers.

Here's a link to the Debian bug report page:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447814

Revision history for this message
SteveM@SML (stevem-spatialmapping-com) wrote :

Good news. It appears this bug has been fixed upstream by the Debian MapServer package maintainers, at version 5.0.0-3 .
Full details are in the Debian bug page (see link in my previous comment).

Revision history for this message
SteveM@SML (stevem-spatialmapping-com) wrote :

Fixed upstream in Debian, at version 5.0.0-3.

Changed in mapserver:
status: New → Fix Released
Revision history for this message
Artur Rona (ari-tczew) wrote :

 mapserver (5.0.0-3) unstable; urgency=low

   * debian/php5-mapscript.postinst: fixed a typo. (Closes: #446985)
   * debian/patches/20_php_build.dpatch: removed. (Closes: #447814)
   * debian/po/gl.po: added. (Closes: #447939)
   * debian/po/fr.po: added. (Closes: #448821)

 -- Fabio Tranchitella <email address hidden> Thu, 08 Nov 2007 15:13:37 +0100

tags: added: patch
Changed in mapserver (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.