Difference between revisions of "PHP"

From Hostek.com Wiki
Jump to: navigation, search
Line 5: Line 5:
  
 
==PHP Versions==
 
==PHP Versions==
The current default PHP version on our servers is '''PHP 5.3'''. We also have '''PHP 5.4''' available.
+
We support all of the current PHP versions on both our Windows and Linux servers. This includes PHP versions 5.3, 5.4, 5.5 and 5.6. Our control panels allow you to choose which version of PHP you would like to use for your site.
 
===PHP Version - Windows===
 
===PHP Version - Windows===
You could control which version of PHP your site uses by going to the "PHP Settings" icon under "Website Settings".
+
In the control panel, you could control which version of PHP your site uses by going to the "PHP Settings" icon under "Website Settings".
 
===PHP Version - Linux===
 
===PHP Version - Linux===
PHP 5.3 is the default unless you request otherwise. If you need PHP 5.4 please request it when ordering hosting. If you are an existing customer, contact our support department to have your site moved to a PHP 5.4 server.
+
You could change the version of PHP for your site by logging into cPanel and clicking on  "Select PHP Version" under "Software and Services". Choose the version from the drop-down menu and click on "Set as current"
 +
 
  
 
==Can I view the PHP configuration for my site?==
 
==Can I view the PHP configuration for my site?==

Revision as of 19:17, 1 April 2015


Do you support PHP?

Yes, we support PHP on all of our Windows and Linux hosting servers.

PHP Versions

We support all of the current PHP versions on both our Windows and Linux servers. This includes PHP versions 5.3, 5.4, 5.5 and 5.6. Our control panels allow you to choose which version of PHP you would like to use for your site.

PHP Version - Windows

In the control panel, you could control which version of PHP your site uses by going to the "PHP Settings" icon under "Website Settings".

PHP Version - Linux

You could change the version of PHP for your site by logging into cPanel and clicking on "Select PHP Version" under "Software and Services". Choose the version from the drop-down menu and click on "Set as current"


Can I view the PHP configuration for my site?

Yes, to do this you'll just need to create a .php file with the following code and browse to the file:

<?php phpinfo(); ?>

Do you support cURL in PHP?

Yes, we support cURL.

mhash - Is the mhash library supported?

Yes, the mhash libary is supported with PHP.

magic-quotes - How can I disable magic-quotes?

To disable magic_quotes you will need to change the following lines in your php.ini from:

;magic_quotes_gpc = Off
;magic_quotes_runtime = Off 

To:

magic_quotes_gpc = Off
magic_quotes_runtime = Off 

How can I use PHP to have a form email me the results?

Here is a sample PHP script that uses submitted form information to send an email:

<?php
if ($_POST['to'] && $_POST['from']) {
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$_POST['from']." <".$_POST['from'].">\r\n";
$headers .= "To: ".$_POST['to']." <".$_POST['to'].">\r\n";
$headers .= "Reply-To: ".$_POST['from']." <".$_POST['from'].">\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: A Server";
mail($_POST['to'], $_POST['subject'], $_POST['body'], $headers); echo
"Mail sent to ".$_POST['to'].".
\n";
}
?>