Welcome Guest, Not a member yet? Register   Sign In
local path
#1

[eluser]bralens[/eluser]
How can i get local path with folder?
Curently in constants.php file i have defined it like so
Code:
define('LOCAL_PATH', $_SERVER['DOCUMENT_ROOT'].'/my_project_root_folder/');

how can i replace '/my_project_root_folder/' so it be more flexible?
#2

[eluser]CroNiX[/eluser]
Create a virtual server in Apache so you don't need a subdirectory.

I create one for each project. It makes things a lot easier when everything is set up like the live project will be.
#3

[eluser]Samus[/eluser]
[quote author="CroNiX" date="1334603908"]Create a virtual server in Apache so you don't need a subdirectory.

I create one for each project. It makes things a lot easier when everything is set up like the live project will be.[/quote]
can you describe how you'd do this abit please?
#4

[eluser]bralens[/eluser]
[quote author="CroNiX" date="1334603908"]Create a virtual server in Apache so you don't need a subdirectory.

I create one for each project. It makes things a lot easier when everything is set up like the live project will be.[/quote]

Thats some thing new to me and first thing tomorrow: google.com
#5

[eluser]CroNiX[/eluser]
Something like this. You will probably have some things you need to change in your main httpd.conf to make this work (like telling it to load the httpd-vhosts.conf file), among others. I don't have everything written down that is necessary, so google is your friend here.

From: Apache_dir/conf/extra/httpd-vhosts.conf
Code:
<VirtualHost *>
    ServerAdmin my_email@my_host.com
    DocumentRoot D:/public_html/project_directory
    ServerName project_name.localhost
    ServerAlias project_name
    ErrorLog D:/public_html/project_directory/error_log
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
</VirtualHost>

So DocumentRoot is set to where this project is located (subdir of my public_html dir).
And, "project_name.localhost" or "project_name" is the url to access the local site in the browser, and also what you would enter in config.php for the base_url (http://project_name.localhost/) (or leave it blank).
#6

[eluser]Samus[/eluser]
[quote author="CroNiX" date="1334604875"]Something like this. You will probably have some things you need to change in your main httpd.conf to make this work (like telling it to load the httpd-vhosts.conf file), among others. I don't have everything written down that is necessary, so google is your friend here.

From: Apache_dir/conf/extra/httpd-vhosts.conf
Code:
<VirtualHost *>
    ServerAdmin my_email@my_host.com
    DocumentRoot D:/public_html/project_directory
    ServerName project_name.localhost
    ServerAlias project_name
    ErrorLog D:/public_html/project_directory/error_log
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
</VirtualHost>

So DocumentRoot is set to where this project is located (subdir of my public_html dir).
And, "project_name.localhost" or "project_name" is the url to access the local site in the browser.[/quote]
Thanks.

Does each project have to be wrapped in those <virtualhost> tags?
#7

[eluser]CroNiX[/eluser]
Yes
#8

[eluser]CroNiX[/eluser]
[quote author="bralens" date="1334604836"][quote author="CroNiX" date="1334603908"]Create a virtual server in Apache so you don't need a subdirectory.

I create one for each project. It makes things a lot easier when everything is set up like the live project will be.[/quote]

Thats some thing new to me and first thing tomorrow: google.com[/quote]This is how you basically set up shared hosting, making it possible to run many websites on the same server. This is what cPanel/Plesk, etc, do under the hood when creating a new domain.




Theme © iAndrew 2016 - Forum software by © MyBB