php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #24809 Packaging PHP Applications for Easy Distribution & Configuration
Submitted: 2003-07-25 16:28 UTC Modified: 2003-07-27 16:57 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: lee at semel dot net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lee at semel dot net
New email:
PHP Version: OS:

 

 [2003-07-25 16:28 UTC] lee at semel dot net
Description:
------------
Since PHP is often used for distributing entire applications at once, it would be great to have a mechanism (similar to Java's WAR files) to make it easy to package, distribute, install, and configure them.

I propose implementing a system for easily packaging PHP applications.  A .PAR file (PHP ARchive) file is a zipfile containing the following:
* All the images, includes, and php files that make up the PHP application.
* a PHP.INI file configured specific to the application.  PHP would ignore values from the master PHP.INI file and use the settings from the PHP.INI file inside the archive. 
* a WEB.XML (or WEB.INI) file defining default configuration parameters speicifc to the application.  Configuration parameters should be able to be overridden by an external file, making them very easy to edit, and to provide an easy way to set up server-specific configurations when installing an application in multiple places.

The application would be accessed through the browser at http://servername:port/nameofarchive/, or at another location specified by the administrator.

Wioth this system, each application could have its own configuration, include path, and libraries, and installing an application becomes a matter of dropping the file into your document root.  If your ISP doesn't let you change PHP.ini, simply installing the PAR file will set everything perfectly for you.  No more having to worry if magic_quotes_gpc or register_globals is set correctly.  No more having to worry if PEAR is installed.

For more info on how Java does it: http://access1.sun.com/techarticles/simple.WAR.html


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-27 14:19 UTC] sniper@php.net
We already have PEAR for this. (pear install)


 [2003-07-27 15:07 UTC] cunha17 at uol dot com dot br
I don't think PEAR Install do what was proposed by Lee, IMHO.
I think that the package won't have to be decompressed to be used and the
PHP engine will use the files inside the package as they were decompressed
on the filesystem.

Correct me if I misunderstood something...

Cristiano Duarte
 [2003-07-27 16:57 UTC] lee at semel dot net
Pear install isn't quite the same idea:

1) My suggestion is intended to overcome the problems of having a common PHP.INI file -- you can't configure one application separately from another

2) My suggestions is intended to be used for entire PHP applications themselves, not modules, libraries or groups of classes.  

3) My suggestion is intended to separate the configuration of the application from the code of the application itself, and set up a standard way of doing this.  On most applications today, configuration is nonstandard, usually involving manual edits to an include file, searches and replaces, manually creating, editing or moving files.  Configuration is often mixed up with the code, so if you want to deploy your PHP app to both a development, test, and production environment, you have the potential for trouble.

If this idea were implemented, installing or deploying a PHP application becomes very easy.  Let's say you want to install "myphpapp" on your account.  

1) Download the application (say "myphpapp.par"), stick it in your document root, and view http://mydomain/myphpapp/.  It works, just as if the files were decompressed there.

2) To customize your configuration, edit a file "myphpapp.ini" or "myphpapp.xml" and put it in the same directory as the par file.  PHP will know where to look for it.  Here you can keep settings speciifc to this particular install: the database password, the color schemes, etc.

3) If you want to maintain a development and production version of the app, going live with a new version becomes as easy as copying one file from your development server to your live server.  You can leave the configuration file there so each server can maintain a separate configuration, with its own database or debugging settings.

4) It would be possible to develop a web based tool to help you can download, configure and install your app through your browser!  Some Java application servers (such as BEA Weblogic) do just that:  You can upload a file containing a Java web application, configure it via your browser, and get it set up in about 2 minutes, with no manual editing of files.  Unfortunately, Java has many other problems, which is why I prefer PHP.

5) If myphpapp.par wants register_globals, magic_quotes_gpc, and asp_tags, but someotherphpapp.par doesn't work with these settings, they can both live side by side, because each one's got a private PHP.INI file zipped up inside of it.

6) Making a PHP Archive file is easy - just use any standard zip program.

All in all, I think this functionality would help make PHP applications easier to install, configure and manage.  A standardized, easy way to do this may even hasten PHP's adoption within corporations, which are used to managing their Java web applications this way.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 23:01:28 2024 UTC