There are several folders on a VPS, each is a separate site, and accordingly a separate address. But still, referring to the php file located one level lower, you have to set the address, starting not from the folder where the site is, but from the root of the VPS (var / html / ..).

How to fix?

There is another strange point that I can not yet explain: In the folder there are js files that I address at the address of the form /file.js. If this folder is assigned an address, the js files function, but if the address is not set, opening the site in the folder by IP, the site cannot find these js files. Explain?

  • Read about relative and absolute paths. In the php file, you specify the absolute path - Semior
  • Just can not be otherwise? And what about the second question? - Sonya Seyrios

1 answer 1

Question 1: connect via DIR Question 2: look at Apache configs, namely virtual hosts

  • Do not tell me yet how to look at the current hosts and their corresponding folders? Httpd -S shows only addresses, the corresponding folders are not displayed - Sonya Seyrios
  • @SonyaSeyrios, I usually do cd / etc / apache2 / sistes-enabled; ls -la; After you can do nano / cat any of the files. This is in the case of debian / ubuntu. RPm / etc / httpd / sistes-enabled / - Vyacheslav Potseluyko
  • Thank! And without root? - Sonya Seyrios
  • @SonyaSeyrios without root except what to see. cat to help you. - Vyacheslav Potseluyko