1

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

8 Comments

I made a index.php that calls the file inside, but it doesn't work. require_once("public/userview/menulogged.php"); It says that the file doesn't exist. Am I writing it wrong the path to it?
@Pillblast, don't forget that if you are developing on a Windows box and hosting on a *nix box that your filename is now case-sensitive.
It's not working like that either. Is it ok to move my files in the root folder? Is it a good practice? @Brad, I know, I made all my files lowercase to start with
Show us the output of $_SERVER['DOCUMENT_ROOT']
thank you a lot. it worked thanks to the /. now i just have to modify some other parths, but I know how. Thanks a lot :)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.