PDA

View Full Version : php_value auto_prepend_file



pghcollectibles
06-02-2009, 11:36 AM
the setting in this title would normally be set in .htaccess if php was installed as a module. In my (our?) server it is setup as a cgi.

there is a solution to this: it can be placed in your php.ini file and is done so without the php_value part as:

auto_prepend_file = "/home/username/public_html/anypath/_prepend.php"
auto_append_file = "/home/username/public_html/anypath/_append.php"

(whatever path or filename you are using)

i have many directories and php.ini has to be in every folder i guess :(
i also have ssh.

Here's the question...

what is the unix command to copy a file (php.ini) from my public_html directory to all sub directories?

shadmego
06-02-2009, 11:43 AM
Why not use php5 Single File or FastCGI? Do either of these setups break anything on your site? Both would allow one php.ini file to exist in the public_html folder and would affect all php files in all folders. I"m personally running php5 in Single File mode and haven't noticed any bad effects from doing so.

pghcollectibles
06-02-2009, 12:52 PM
no they wouldnt. i hate to ask without researching myself but how do i do that? with only a quick browse i didnt see a difference in the files. is it configured somewhere else. (i chose the single file radio button from the same php config spot in the cpanel after you posted) it still isnt working, is there propagation for that? i went back to see if i had done something wrong, read the pros and cons of fastcgi and then turned it on (and hit save as i did last time) still nothing

i thought it wasnt working but in my file i was prepending i had

if (file_exists('../folder/index.php')) include_once('../folder/index.php');but due to the fact that it is being included from many directories/domains the include would not know what ../ meant to me
i just changed it to

if (file_exists('/home/username/public_html/folder/index.php')) include_once('/home/username/public_html/folder/index.php');and all is good.

thanks for the tip on fastcgi shad