"/" Site root in PHP

Asked

Viewed 69 times

-2

Friends sorry if I’m repeating any questions here, but I searched and did not specifically find my problem, so let’s go.

I took a course in videaula, and created a PHP site in which, on my machine (windows 10 with Xamp) I edited the HOSTS file, created a hostvirtual pointing to the folder where the site is (c:/xamp/htdocs/meusite).

Now I made a VM with CENTOS7, installed apache (HTTPD), moved my files and database, etc. including my . HTACCESS.

Play summary, in my application I refer my routes based on the root:

"\way"

In my windows it intends the root so "c: xamp htdocs meusite\"

AT CENTOS he understands the root as the root of the system "\"

when do a include for example include " css estil.css" in windows it finds the file smoothly "C: xamp htdocs meusite css style.css"

in CENTOS it does not find the file because it looks in: "css style.css" the correct one was to search in "var www html meusite css style.css";

I think that’s it, I need to learn a way that when I give a " " in php it understands that it’s not the " of the system but a " var www html meusite folder"

  • You should set up VHOST pointing to the folder where your site is.

  • Yes. When I open my server his name is srvintra, it already falls in my folder, straight.

  • Detail, via browser, apache redirects to my application folder, only via PHP it searches at the system root

1 answer

-2

Check apache for Documentroot configuration In your case you should have the following configuration, for apache2.4

DocumentRoot /var/www/html/meusite
<Directory "/var/www/html/meusite">
        AllowOverride all
        # New directive needed in Apache 2.4.3:
        Require all granted
</Directory>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.