Manual PHP-Values .htaccess/en

Aus EUserv Wiki

Wechseln zu: Navigation, Suche

Setting PHP values via .htaccess file

Inhaltsverzeichnis

Setting PHP values via .htaccess file

General

If you have a hosting plan at EUserv you can't access the php.ini file. Anyway there is the possibility to set PHP values via a .htaccess file. The following guide shows you how to do this.


Setting PHP values

Preparation

Checking PHP version

To check which PHP version is installed on your webspace, please follow these steps:

  • Create a new file with the following content:
<?php
phpinfo();
?>
  • Save the file under info.php and upload the file via FTP to your webspace under www/data/
  • Enter the following address in your browser (Replace [domain] with the domain of your webspace):
http://www.[domain].com/info.php

You can find the installed PHP version of your webspace on the header of the file.


Datei:Php_1.jpg



Checking PHP values for your hosting plan

To check for the possible PHP values within your hosting plan please check the detail view on our homepage:

http://www.euserv.com/en/


Setting PHP values for PHP 5.2

  • Edit/Create the .htaccess file
  • Add the following line in the following format (Replace [parameter] with the parameter which should be changed and [value] with the value):
php5_value [parameter] [value]
  • Upload the .htaccess file via FTP to your webspace under www/data/
  • Set the user-rights for the .htaccess file to 644 (readable and writeable by owner, just readable by other users).


Examples

Setting PHP value memory-limit

  • Add the following line to set the php value memory_limit to 128 MB:
php5_value  memory_limit  128M

Setting PHP value post_max_size

  • Add the following line to set the php value post_max_size to 128 MB:
php5_value  post_max_size  128M

Setting PHP value max_execution_time

  • Add the following line to set the php value max_execution_time to 30 s:
php5_value  max_execution_time  30s

Setting PHP value upload_max_filesize

  • Add the following line to set the php value upload_max_filesize to 32 MB:
php5_value  upload_max_filesize  32M


Setting PHP values for PHP 5.3 or higher

  • Edit/Create the .htaccess file
  • Add the following line with the following format (Replace [parameter] with the parameter which should be changed and [value] with the value):
php_value [parameter] [value]
  • Upload the .htaccess file via FTP to your webspace under www/data/
  • Set the user-rights for the .htaccess file to 644 (readable and writeable by owner, just readable by other users).


Examples

Setting PHP value memory-limit

  • Add the following line to set the php value memory_limit to 128 MB:
php_value  memory_limit  128M

Setting PHP value post_max_size

  • Add the following line to set the php value post_max_size to 128 MB:
php_value  post_max_size  128M

Setting PHP value max_execution_time

  • Add the following line to set the php value max_execution_time to 30 s:
php_value  max_execution_time  30s

Setting PHP value upload_max_filesize

  • Add the following line to set the php value upload_max_filesize to 32 MB:
php_value  upload_max_filesize  32M


Checking set PHP values

To check if the set PHP values have been set, proceed as follows:

  • Enter the following address in your browser (Replace [domain] with the domain of your webspace):
http://www.[domain].com/info.php
  • Search for the corresponding PHP value under the section Core.


Datei:Php_2.jpg


  • Check if the set value has been changed.
  • Finally delete info.php. So the configuration of your webspace can't be seen by others.