user1633322 user1633322 - 1 year ago 74
PHP Question

php require statement not working when uploaded to host

I have a php file that lives /php/dbtest.php

it worked perfectly fine on my local machine, running xampp I have uploaded it onto a Linux webhost, now the line

require '/../app/start.php'

I have tried echoing error_get_last() but it returns nothing. I am unsure what the problem is or where to look next I have tried without the forward slash. All help very much appreciated

Answer Source

Your link should be not good. Because with the first /, you make reference to the root directoy of your linux system and generally website are contain in /etc/www. So try :

require '../app/start.php'  

or something that is more linked to the way your document are present in your system.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download