"/" Site root in PHP

-2

I'm sorry if I'm repeating any questions here, but I've searched and did not specifically find my problem, so come on.

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

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

Summary of the joke, in my application I refer to my routes based on the root:

"\ path"

In my windows he intends the root like this "c: \ xamp \ htdocs \ mysite \"

IN CENTS it understands the root as being the root of the system "\"

when an include for example include "\ css \ estil.css" on windows it finds the file without problems "C: \ xamp \ htdocs \ mysite \ css \ style.css"

in CENTOS it does not find the file because it looks in: "\ css \ style.css" The correct thing was to look "\ var \ www \ html \ mysite \ css \ style.css";

I think this is, I need to learn a way that when I give a "\" in the php it understands that it is not the "\" of the system but rather a "\ var \ www \ html \ mysite"

    
asked by anonymous 04.10.2018 / 15:43

1 answer

-2

Check Apache for the 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>
    
24.10.2018 / 18:06