简体   繁体   中英

Confusion regarding Apache document root

In one of the applications that I am working on for my company, I came across a weird behaviour or maybe it's just my misunderstanding and I hope I can get some clarification. The application is served by Apache and the root is: /company/client . For every page that I visit, for example https://11.11.11.11/index.phtml , it will actually point to the file in the server /company/client/index.phtml and so on. In one of the modules of the application, it contains a move_uploaded_file php function, and the target directory is /images/example/, when the page is run, the app is trying to go to the absolute server root /images/example/ instead of /company/client/images/example/ .

Also the a new windowed opened up by window.open has an img tag having src='/images/exmaple/' , this points to the server root instead of /company/client/images/example/ , is this expected?

Am I missing anything, or is it something to do with Apache configuration?

Additional info:

The application is served as a virtual host in conf file, with DocumentRoot "/company/client/".

The page that is executing window.open and php function is used as an Iframe inside /company/client/index.phtml

sorry for my mistake.

Thanks for the help from the everyone especially Chris G, the problem was that the code is using a GET variable incorrectly, as a result the image name isn't passed. And I got confused because someone made a mistake in the code by moving image relative to the root folder which is incorrect. That made me think that PHP is also treating path like the client side which is a mistake. I'm guessing I can conclude that the web server document root only applies to everything client side, like the url, JS, HTML?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM