Copy default php.ini

PHP

Public Domain

Copy default php.ini file on remote server.

Download (right click, save as, rename as appropriate)

Embed

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php
// location of the php.ini file you wish to copy (located on host)
// you can find the location of the default php.ini file by looking on your phpinfo() page
$defaultPath = "/usr/local/lib/php.ini";
// location where you want to copy the php.ini file to (your public_html folder)
// change this to your directory on the server
$customPath = "public_html/php.ini";
// nothing should change below this line.
if (file_exists($defaultPath)) {
  $contents = file_get_contents($defaultPath);
  copy($defaultPath, $customPath);
} else {
  $message = "Input file not found.";
}
echo $message;
?>