How to package PHP projects

Source: Internet
Author: User
PHP Project Packaging method

People often get some programming jobs, such as designing corporate websites, doing financial, statistical systems, etc. Perhaps because of the needs of friends, perhaps a pocket. Whatever the reason. And so on, to show each other, installation, it becomes a problem. Enterprise website say, at least need a virtual host or something, but OA, finance ... These internal systems are not good to say, always can not throw code and database to others, write a description, let them follow the instructions to configure the environment, install the code bar. This is obviously outrageous, you know interlacing as Foster Ah! Furthermore, in case the customer is 108,000 miles from the place where he is staying, it is not always possible to install it, so it is estimated that all income will not be able to stop the fare. So the WAMP environment +php program + maintenance of the loading and unloading program to play EXE installation package is necessary. To let customers install PHP program is as simple as installing QQ, convenient!

Methods should have n multiple. There are only three of them I know.

1. Use RAR automatic decompression function.

2. Use Windows packaged software InstallShield to make the installation package.

3. Pack with ready-made items! (hehe, as the saying goes, stand on the shoulders of giants!) I'm a lazy man, too. )

Above 1.2 methods, we can through Baidu, Google search search. Don't bother searching ... =.=! than I have ...

Here I'll give you a detailed look at my method. This method is also a few days ago to help friends to do a real estate information system when they collected.

First, a clean green PHP runtime environment is needed first. The components are configured according to the project requirements first. I take F:\PHPServer as the environment root directory, general components Apache2+php5+mysql5+zo need to open GD library ... Configure 80,3306 ... This people should be more familiar than me. It is best to have a green version of the ZIP format, such as PHPNOW,XAMPP, that can be applied to a more customized integration suite. Don't worry, the download link will be written below. I use the Phpnow, small and convenient customization high!

Second, put our system to install, check the wrong debugging, everything OK after. Okay, that's half done. At this time someone spoke, "quack" "Mongolian Doctor" "Liar". Well! Guys, don't worry, it's behind you! Now this folder Phpserver, to ensure that you do not import configuration files to the outside world, we must ensure the independence and integrity of phpserver, is to ensure its green.

Third, to these green integration kits are generally written in a good bat is a batch file, directly start the input number can start and close the service. At this time we can use RAR self-extracting + run batch processing, can, but now by a lot of anti-virus software blocked interception. I'm actually using this principle as well. I found a wrapper on the Internet. Make_exe (from Phpnow) can play the. 7z+ packaged file interface information into an EXE run package and automatically run the batch file in the 7z archive after running self-extracting. There are make_exe.cmd,phpserver.sfx,phpserver.sfx.cf three files in the Make_exe.zip bag. See this, we should have a train of thought. First, press phpserver into the phpserver.7z file and configure it. Modify the PHPServer.sfx.cf file, and then run the Make_exe.cmd.

First: Make_exe.cmd code
Set v=1.2
copy/b/y Phpserver.sfx + PHPServer.sfx.cf + * * phpserver%v%.exe | | Pause
It's clear! "Set v=1.2" is a version, then requires three files, packaged.
PHPSERVER.SFX.CF code, open method, drag directly to TXT on the line

;! @Install @! utf-8!
Title= "Real Estate Information management system V1.2"
beginprompt= "# Real Estate Information Management System V1.2 installation package #\n\n * Confirm that you are not running IIS and other services that occupy port 80. \ n * If you have other similar packages installed, please stop or uninstall them first. \ n * Do not move the installation directory when the installation is complete. \ n: Xilo qq:110026985 home <a href= "http://www.xilo.cn/" >http://www.xilo.cn</a>. "
Extractdialogtext= "Please later, you are extracting the file ..."
Extracttitle= "Extracting ..."
extractpathtext= "Please select the decompression path (English characters only):"
Extractcanceltext= "Cancel"
Cancelprompt= "Are you really going to quit?"
Guiflags= "4+8+32+64+256+2048"
Installpath= "D:\\phpserver"
runprogram= "Cmd/c setup.cmd"
;! @InstallEnd @!
I don't have to explain what I want to show. Note This sentence installpath= "D:\\phpserver" for the installation directory, as well as the decompression run runprogram= "cmd/c setup.cmd" This bat, that is, the command to start the Apache,mysql service. The following is the order of Phpserver's setup.cmd. Because too many simple paste a few words!


@echo off
REM--<a href= "http://www.xilo.cn/" >http://www.xilo.cn</a>
REM-by Xilo (qq:110026985)
Setlocal enableextensions
Call Pn\config.cmd
prompt-$g
Title Initialization Phpserver%pnver%-Apache + PHP + MySQL
Echo ____________________________________________________________
Echo ^| ^|
Echo ^| ###### is installing the gallant Real Estate Information Management System Environment Kit ###### ^|
Echo ^|____________________________________________________________^|
Echo.

: Copy
Echo ____________________________________________________________
Echo ^| ^|
Echo ^| Start file processing ... ^|
Echo.
REM Build Directory
If not exist%apadir%\conf\extra MD%apadir%\conf\extra
If not exist%apadir%\logs MD%apadir%\logs
Omitted............
Omitted............
All the files will be attached below! The simple explanation is to configure, copy, start! I don't know, I'll explain it downstairs.
Map:

The first step:

Step Two:



Step Three:



In fact already OK, I believe we also understand, the first hair technology is a bit too Tang's monk! Haha! If the perfect word is to uninstall the command Ah! Backup DATABASE Ah! Add to StartMenu! It's all very simple! Finally, all resources are from the Internet, I hope the software authors do not bother me!
Posts Link!!!
1.PHPnow the official
2.make_exe.zip
3. Streamlined Setup.cmd
4.7z is very powerful!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.