colorsolid Posted January 28, 2008 Share Posted January 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/88143-using-php-to-copy-a-file-to-subdirectories/ Share on other sites More sharing options...
toplay Posted January 28, 2008 Share Posted January 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/88143-using-php-to-copy-a-file-to-subdirectories/#findComment-450971 Share on other sites More sharing options...
colorsolid Posted January 28, 2008 Author Share Posted January 28, 2008 Sorry about that, and thanks for the quick reply. So how exactly do I go about doing that? I am really new to php, and don't know much about scripting. Quote Link to comment https://forums.phpfreaks.com/topic/88143-using-php-to-copy-a-file-to-subdirectories/#findComment-450977 Share on other sites More sharing options...
toplay Posted January 28, 2008 Share Posted January 28, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/88143-using-php-to-copy-a-file-to-subdirectories/#findComment-450998 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.