Section: /software/thttpd/| Permanent Link. Thttpd is a simple, small, portable, fast, and secure HTTP server. It handles only the minimum necessary to implement HTTP/1.1. It also has a very small run-time size, since it does not fork and is very careful about memory allocation. I have managed to download and unpack thttpd-2.27 from How to install it? OS: Linux Mint 17.3 64bit On.
All Linux distributions comes with PHP. However, it is recommended to download latest PHP source code, compile and install on Linux. This will make it easier to upgrade PHP on an ongoing basis immediately after a new patch or release is available for download from PHP. This article explains how to install PHP5 from source on Linux.
1. Prerequisites
Apache web server should already be installed. Refer to my previous post on How to install Apache 2 on Linux. If you are planning to use PHP with MySQL, you should have My SQL already installed. I wrote about How to install MySQL on Linux.
2. Download PHP
Download the latest source code from PHP Download page. Current stable release is 5.2.6. Move the source to /usr/local/src and extract is as shown below.
3. Install PHP
View all configuration options available for PHP using ./configure –-help (two hyphen in front of help). The most commonly used option is –-prefix={install-dir-name} to install PHP on a user defined directory.
In the following example, PHP will be compiled and installed under the default location /usr/local/lib with Apache configuration and MySQL support.
4. Configure httpd.conf for PHP
Modify the /usr/local/apache2/conf/httpd.conf to add the following:
Make sure the httpd.conf has the following line that will get automatically inserted during the PHP installation process.
Restart the apache as shown below:
5. Verify PHP Installation
Create a test.php under /usr/local/apache2/htdocs with the following content
Go to http://local-host/test.php , which will show a detailed information about all the PHP configuration options and PHP modules installed on the system.
6. Trouble shooting during installation
Error 1: configure: error: xml2-config not found:
While performing the ./configure during PHP installation, you may get the following error:
While performing the ./configure during PHP installation, you may get the following error:
Install thelibxml2-devel and zlib-devel as shown below to the fix this issue.
Error 2: configure: error: Cannot find MySQL header files.
While performing the ./configure during PHP installation, you may get the following error:
While performing the ./configure during PHP installation, you may get the following error:
Install the MySQL-devel-community package as shown below to fix this issue.
References: PHP Manual
> Add your comment