简体   繁体   中英

How to deploy my PHP website?

This is a very NOOb questions, I know, but this is my first website that I made, and I have no idea how to deploy it. I made it using PHP, and my file structure is as follows:

Includes 
Public
  ->images
  ->...
  ->...
  ->userview

All my files that will be accessed by the users are in the userview document, and my entry page which is login.php, is also there. How should I deploy it?

I tried just copying the files over to my hoast using filezilla, but it gives a glorious 404 and 403 error depending what i am trying to access.

The output for $_SERVER['DOCUMENT_ROOT'] is /var/chroot/home/content/40/7141640/html

Just copying is right, but you should create a file called index.php (within root folder of your webhosting folder) which is mostly called first. But calling login.php directly should work either.

Wrong path: try sth. like this as path:

$_SERVER['DOCUMENT_ROOT'] . "/public/userview/menulogged.php" 

Every webhoster is different, so it´s difficult to find the correct path for me, just ask your webhoster if this doesn´t work or try another directory.

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