in case somebody need this:
( automatic translation from http://faq.1and1.fr/scripts/php/phpini/4.html )
Manually copy the file php.ini
may be be a very long depending on your application (Joomla for example).
A simple PHP script can perform the copy operation for you, and thus place the php.ini
in all directories and subdirectories of the application.
Here is a sample PHP script:
File 1: phpini.php |
<? Php
/ / Set this value to Y if you only want to overwrite old php.ini files
/ / Set this value to N if you want to put a php.ini file in Every directory
OverwriteOnly $ = "N";
if ($ overwriteOnly == "Y") echo "Operating in Overwrite Only Mode <br>";
$ Path = "/ homepages / xx / dxxxxxxxxx / htdocs";
$ Source = $ path. "/ Php.ini";
if (file_exists ($ source)) die ('Error - no source php.ini file');
function search ($ dir) {
global $ source;
global $ overwriteOnly;
$ Dh = opendir ($ dir);
while (($ filename = readdir ($ dh))! == false) {
if ($ filename! == '.' AND $ filename! == '..' AND $ filename! == 'cgi-bin' AND is_dir ("$ dir / $ filename")) {
$ Path = $ dir. "/". $ Filename;
$ Target = $ path. "/ Php.ini";
if (file_exists ($ target) AND $ overwriteOnly == "Y") {
echo "$ path <b> skipped - no php.ini file </ b> topics:";
Else {}
echo "$ target <br>";
if (copy ($ source, $ target)) echo "<b> Write failed for $ target </ b> topics:";
if (file_exists ($ target)) chmod ($ target, 0600);
}
search ($ path);
}
}
closedir ($ dh);
}
search ($ path);
echo "Done.";
?>
|
|
To use the above script, you must know the path to your webspace (the path).
 |
Via the Customer Area In your Customer Area, click Configure Domains Select the checkbox to the left of the field Click Info Then you find home directory with a value similar to /homepages/xx/dxxxxxxxxx/htdocs/.
|
 |
SSH If your pack has SSH access, you can login after entering the command
who will provide you the home directory of your webspace. |
Now in possession of this information, you can adapt the script to your accommodation.
Note the latter in the above script in place of votre_repertoire_d_accueil which lies next to the variable $path =
The line of the file must thus be provided
$ Path = "/ homepages / xx / dxxxxxxxxx / htdocs";
|
|
Now save the code in a file phpini.php
(for example) and place it at the root of your webspace with the file php.ini
containing the new variables / values.
Call the file with your browser, copying will be done automatically.