Jump to content

Using php to copy a file to subdirectories


colorsolid

Recommended Posts

I need help copying my php.ini file to all of the subdirectories on my site.  There are over 300, and I've done it manually, but I don't want to have to do it all over again every time I have to make a change.  I found a script here -->http://tips-scripts.com/?tip=php_ini_copy  but I don't know how to configure it, it just tells me there is no source php.ini.  Thanks in advance for any help.

First ask yourself are the settings that you need in php.ini can be set at runtime?  If so, then I would use an include/require file where you set everything you need using ini_set(). Then include that file in all your scripts. In the future, when you need to change a setting, you only have to change it in one place/file.

 

I assume you need this to override your web hosts php.ini settings and that's how they allow you to do it. Most hosts only need you to put one version of php.ini in your root (member) area. Check with your web host provider if you haven't already.

 

Please note that we don't support third-party scripts in PHP help area...so I've moved this post to here.

 

Good luck.

 

You have to learn PHP. Pick up a PHP book, read tutorials (ours and others) and also use php.net as reference.

 

See:

 

http://us2.php.net/manual/en/function.ini-set.php

 

http://us2.php.net/manual/en/function.include.php

 

This lists all the things that can be changed. Look at the table at the bottom of that page ("Definition of PHP_INI_* constants") to understand what they mean and which settings can be set at runtime using init_set() or have to be modified in the php.ini file:

 

http://us2.php.net/manual/en/ini.php#ini.list

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.