php - Allowing 1 Directory on a Webserver to be accessed for Includes by others -


the circumstances this, have hosting package website, doesn't allow me access php.ini or httpd.conf. have taken on various clients, want keep current hosting packages.

what want allow access directory on particular path, in domain, can keep php includes in. can share across various clients sites, don't have access sites , update files.

a friend of mine mentioned curl , fopen add lag. possible use, , know little them, .htaccess document open directory read access include requests other web servers. want keep webspace secure possible. advice , please.

remember accessing includes via curl/fopen using urls mean you're accessing php includes if regular php scripts. unless configure server serve .php files plain text in particular directly, include scripts executed, , output.

e.g.

include.php on centralized "include" server

<?php  function foo() {     echo 'hello foo'; } 

some script on client site:

<?php include('http://includes.example.com/inculde.php'); 

will include nothing. include.php script producing no output. not foo() function available in client site, because no php code returned remote site.

on other hand, if had this:

<?php echo '<' . '?php'; ?>                 function foo() {   echo 'foo'; } 

then plaintext happens php code, , include work expected.

however, should not using include() remote files. opens whole can of attack vectors malicious user. perhaps have dns glitch, , attack can remap ip of include.example.com, client sites loading code server under control, , of clients compromised.

perhaps there's network glitch , whatever reason central include server not reachable client machine's - site dead in water because server isn't available.

basically, you're introducing single point of failure system, failure take out of clients @ same time. not system, @ all.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -