I am developing a PHP website, but I can’t see the php.ini file on my server. My host will not provide it.
So I'm now going to create a copy of that php.ini file.
So I have tried system().
I searched in Google and I found Creating a custom php.ini using the server default php.ini and configuration settings.
Here they are using it like this:
system("cp /usr/local/php5/lib/php.ini /home/YOURUSERNAME/php.ini");
On my server when I looked at the phpinfo(), my php.ini location is:
/ms/svc/php5/conf/php.ini
And when I looked for the current directory of my server using
$dir_path = str_replace( $_SERVER['DOCUMENT_ROOT'], "", dirname(realpath(__FILE__)) ) . DIRECTORY_SEPARATOR;
I got my current directory as:
/netapp/whnas-swamp/s11/s11/01712/www.sample.com/webdocs/
So my system command will now look like this:
system("/ms/svc/php5/conf/php.ini /netapp/whnas-swamp/s11/s11/01712/www.sample.com/webdocs/php.ini");
I have named this page getthephpini.php.
And when I browsed this page I got a blank page, but no new php.ini file created in my server.
Is any mistake in that code? What is the correct way?