AlpineWeb Design Home
Check Domain Name Availability
Customer Login | Contact Us | Mobile Users
Live Help
    Support Home > Hosting > VPS > FreeBSD > Webserver > Modules >

The mod_php4 Apache Module

There are several different ways to install PHP4 on the FreeBSD VPS. The best way is to install the mod_php4 Apache Module. Another less desirable method is to install the PHP4 CGI to which PHP4 files are redirected by your web server.
NOTE: PHP no longer creates GIF images via lib-gd. Due to patent restrictions on the GIF compression algorithm we can no longer support it. The PNG Image Format has support for alpha channels, gamma correction, has better compression than GIF compression and supports 48-bit color depth (versus 8-bit color GIF images), and is now widely supported by nearly all modern web browsers.

Installation

Connect to your Virtual Private Server via SSH, su to root, and do the following:
  1. Install the PHP4 Apache modules.
    # vinstall php4
    NOTE: Any version of PHP prior to 4.3.1 has a known security vulnerability which can compromise your Virtual Private Server. If you are using any version prior to PHP4.2.2, we strongly encourage you to upgrade to the current version.
    When you run the vinstall command, you will be given the option to select which extensions you want to use. In order to not waste memory on your Virtual Private Server, we recommend that you only select extensions you will actually be using. If you find you need to add or remove extensions at a later time, you can manually edit the php.ini file, or use the vinstall command to change the active extensions.
  2. The installation process should configure your web server to dynamically load the PHP4 Apache module. Check to make sure the following line is in your web server configuration file (/www/conf/httpd.conf).
    LoadModule php4_module libexec/mod_php4-4.3.10.so
    NOTE: In versions of PHP4.2.2 and later, one of the default settings has been changed. This has been found to affect several commonly used scripts, including TWIG. If you are using TWIG or are having trouble with scripts that worked without problems prior to upgrading to version 4.2.2, create or edit the file named php.ini in the ~/usr/local/lib/ directory of your Virtual Private Server. The php.ini file needs to contain at least this line:
    register_globals = On
  3. Make the following additions and modifications to your web server configuration file (/www/conf/httpd.conf).
    1. Modify the DirectoryIndex line so that PHP4 files will be included as directory indices.
      DirectoryIndex index.php index.php4 index.php3 index.cgi index.html index.htm
    2. Add the following lines so that all files with .php, .php3, .php4, and .phtml extensions will be redirected to the PHP4 Apache module.
      AddType application/x-httpd-php .php .php3 .php4 .phtml
      AddType application/x-httpd-php-source .phps
    3. Restart Your Web Server.
  4. To test your PHP installation, try creating the following ~/www/htdocs/test.php4 document and viewing it in your web browser.
    <HTML>
    <BODY>
    <?php
      phpinfo();
    ?>
    </BODY>
    </HTML>
    
    The phpinfo() function reports the version number, as well as the features that are compiled into PHP.

image


DocumentationDocumentation Home
Help Desk
Knowledgebase

Business Services
PC Data Backup Support
Sugar CRM



Web Hosting
Getting Started Guides
Starter Hosting
Signature Hosting
Virtual Private Servers
  • FreeBSD VPS v2/3
  • Linux VPS
Managed Private Servers
  • FreeBSD MPS v2/3
  • Linux MPS





image
Authorized viaVerio Reseller         Authorize.net         Miva Certified Business Partner
Homepage | About Us | Privacy Policy | Rates & Fees | Contact Us | Sitemap

All contents © Copyright 1997-2010 AlpineWeb Design