sde
Verified User
DirectAdmin requires a specific naming of the tar file and its contents to successfully build with the customapache scripts.
This makes it dififcult to build snapshots because the tar.gz files are named without a dash after the 'php' in the filename.
It also makes it difficult to use PECL modules because they don't exist in the PHP tar file and when you run a ./build clean, your extracted PHP directory is wiped out.
Below are the steps I use to build PHP from snapshot source with custom PECL modules.
1. Download a version of PHP. For this example, i'm going to use a 5.2.0 snapshot from http://snaps.php.net/ .
2. Extract the file and rename it in the appropriate format. The correct format is: php-<version>. Example: php-5.2.0
3. Add any PECL extensions you would like to the ext/ directory of PHP. Example for the uploadprogress extension: /usr/local/directadmin/customapache/php-5.2.0/ext/upoadprogress. Note that after decompressing the extension, there is usually a version number at the end. Make sure you rename the file without the version number and that it is all lower case.
4. Delete the PHP configure file and create a new one. This makes sure that your PECL modules are included as options for your build.
5. If you added PECL extensions, make sure you add the appropriate configuration option to /usr/local/directadmin/customapache/configure.php. If you are unsure at the configuration option, you can run ./configure --help in the php-5.2.0 directory. On the same topic, you may want to review all the options of your version of PHP to see everthing that is available and compare with your current configure.php file. The option list can be pretty long so I usually create a file to view with my configure script side by side. ./configure --help > conf_options.txt
6. Create the tar.gz file for the new PHP directory with the extensions.
7. Make sure that the PHP version you want to compile is defined in /usr/local/directadmin/customapache/build.
8. Now build PHP like you normally would.
This makes it dififcult to build snapshots because the tar.gz files are named without a dash after the 'php' in the filename.
It also makes it difficult to use PECL modules because they don't exist in the PHP tar file and when you run a ./build clean, your extracted PHP directory is wiped out.
Below are the steps I use to build PHP from snapshot source with custom PECL modules.
1. Download a version of PHP. For this example, i'm going to use a 5.2.0 snapshot from http://snaps.php.net/ .
Code:
# cd /usr/local/directadmin/customapache/
# wget [url]http://snaps.php.net/php5.2-yyyymmddhhmm.tar.gz[/url]
Code:
# tar -zxvf php5.2-yyyymmddhhmm.tar.gz
# mv php5.2-yyyymmddhhmm.tar.gz php-5.2.0
3. Add any PECL extensions you would like to the ext/ directory of PHP. Example for the uploadprogress extension: /usr/local/directadmin/customapache/php-5.2.0/ext/upoadprogress. Note that after decompressing the extension, there is usually a version number at the end. Make sure you rename the file without the version number and that it is all lower case.
Code:
# cd /usr/local/directadmin/customapache/php-5.2.0/ext/
# wget [url]http://pecl.php.net/get/uploadprogress-0.3.0.tgz[/url]
# tar -zxvf uploadprogress-0.3.0.tgz
# mv uploadprogress-0.3.0 uploadprogress
# rm uploadprogress-0.3.0.tgz
4. Delete the PHP configure file and create a new one. This makes sure that your PECL modules are included as options for your build.
Code:
# cd /usr/local/directadmin/customapache/php-5.2.0/
# rm configure
# ./buildconf --force
5. If you added PECL extensions, make sure you add the appropriate configuration option to /usr/local/directadmin/customapache/configure.php. If you are unsure at the configuration option, you can run ./configure --help in the php-5.2.0 directory. On the same topic, you may want to review all the options of your version of PHP to see everthing that is available and compare with your current configure.php file. The option list can be pretty long so I usually create a file to view with my configure script side by side. ./configure --help > conf_options.txt
6. Create the tar.gz file for the new PHP directory with the extensions.
Code:
# cd /usr/local/directadmin/customapache/
# gtar cvzf php-5.2.0 php-5.2.0.tar.gz
7. Make sure that the PHP version you want to compile is defined in /usr/local/directadmin/customapache/build.
8. Now build PHP like you normally would.
Code:
# cd /usr/local/directadmin/customapache/
# ./build clean
# ./build php
Last edited: