tags:

views:

112

answers:

2

Hi,

I am developing a php website.

I cant see php.ini file in 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 got this link. http://drupal.org/node/290592

Here they are using like this

system("cp /usr/local/php5/lib/php.ini /home/YOURUSERNAME/php.ini");

in my server when i looked 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 this

$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 lke 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 as getthephpini.php

and when i b rowse this page i got a blank page but no new php.ini file created in my server.

Is any mistake in that code??? Can any one show me the correct way

Please help me

Thanks

+3  A: 

A properly configured PHP installation will not give you physical access to php.ini from your PHP code.

What you are trying to do is not possible.

Eric J.
A: 

What you are looking for is this command that lets you change the settings from within PHP code.

ini_set('upload_max_filesize', '64M');

Editing php.ini directly (even if you had access to it) would likely not have worked, because the web server would need to be restarted for the setting to take effect.

denrk