Where to put PHP files, root directory or public_html directory? -


i saw alot of frameworks laravel, zend, symfony .... , noticed put php files in root directory, when saw wordpress , vbulletin , alot of famous scripts, , noticed put php files in public directory.

i wanna know best place put php files. root directory or public_html directory? better? , why! , difference between them?

assuming "root directory" mean somewhere outside of web server's document root, , "public_html" web server's document root...

it's best practice have scripts must directly accessible within web server's doc root. if happens php gets disabled, don't want whole world downloading copies of source code. scripts can include files wherever can access on disk, it's possible put loader in web server's doc root , keep whole application out of there. common , best practice.

wordpress doesn't default because folks installing wordpress don't know they're doing. it's easier them extract tarball 1 place , not have worry it. ones know doing can customize installation paths if desired.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -