Notes about PHP6, PHP5, PHP4,
and .htaccess:
Our Web Forms Package should run under PHP4, PHP5, and PHP6.
But on some servers, some tweaking may be needed. See below.
Running under PHP5
With the adopting of PHP5 by most modern web hosts and
control panels, there is a need to understand “how” your web host and server is
running PHP5 in addition to just whether it supports it or not.
Apache 2.0x – 2.2x supports compiling either PHP4 or PHP5
or BOTH. If you are running both on your server – then your host will most
likely have a protocol for invoking PHP 4 if PHP5 is running. More often than
not this is done via a file extension such as “whatever.php4”.
This is because it is not possible to run both PHP5 and PHP4 as Apache
modules, rather one must be run as CGI, with the other one being run as an
Apache module.
In the case of an upgrade at the hosting level, most likely the PHP5
will be run as a module while PHP4 will be run as CGI.
Helpful tips & workarounds to aide running our forms or
other scripts under PHP5:
Put an .htaccess in your /public_html/ (cPanel) or /httpdocs/
(PLESK) or root directory, with:
AddHandler application/x-httpd-php4 .php
This will allow your scripts to access PHP4 after any
upgrade to PHP5.
How to tell if you are running PHP 4 or 5 and whether it
is run under phpsuexec
The first
step is to find out if your server is using phpsuexec. This can be done by
running a simple 'php info' script.
To check which version of PHP
is installed on your website's server, we have included the file phptest.php
which contains just the following line of code:
After uploading to your server: enter the full url of this file into
your browser. For example: http://www.your-website.com/forms/phptest.php.
Note: For added security, you might wish to delete this file from your
server when you are done.
Load the file in your browser and in the top section find the line 'Server API'.
If it shows 'CGI' then your account is on a server with phpsuexec. If it lists
the server API as 'apache' you are not on a phpsuexec server.
The next step is to add the appropriate command to your .htaccess file. For the
primary domain name on an account the .htaccess file should be located in the
public_html folder. Create the file if it does not exist. If it does exist, then
make sure to save a backup copy.
Rename it .htaccess-backup.
Place one of the
following commands in the file:
If your account is not on a phpsuexec server use:
AddType application/x-httpd-php5 .php
If your account is on a phpsuexec server use:
AddHandler application/x-httpd-php5 .php
For your convenience, we have included 3
.htaccess files located in your download. We have name them something like
z-.htaccess-AddHandler-application-php4.txt.
Rename the appropriate file .htaccess (it will not function with the name we
have given it. Your server looks for a file named .htaccess).
You might try all 3 files if the first one doesn't do the job. It might work
perfectly by keeping it in the "forms" directory. But you might need to
place it in the "root", which is usually called htdocs or public_html.
In other words:
Your web hosting service must have PHP installed and properly configured for
the program to run. Please make sure they have PHP and what version they are
using. Bestwebforms will work with PHP 4.2.0 or later.
Rename the file z-.htaccess-AddHandler-application-php4.txt (for PHP 4) to
.htaccess,
or rename z-.htaccess-AddHandler-application-php5.txt (for PHP 5) to
.htaccess and try to access your web forms again. If that doesn't work, you
must ask your hosting service to add an application handler for proper
execution of your PHP files.
|