0

I have the following directory structure:

- m
--> css
--> js
--> includes

- php_scripts

In my m/includes there is a file called functions.php and in my php_scripts there is a file called conn.php. I would like to include the conn.phpin the functions.php file but I have no success with it:

<?php
require_once("../../php_scripts/conn.php");

I would assume the previous code is correct but it simply doesn't work. Even if there is no other code in functions.php (just the require), the page loads blank. If I check httpfox I see the result 500 - internal server error. If I comment the line with require_once, it works flawlessly. Any ideas? Thanks a lot!

2
  • You could check your document root using ?php phpinfo();? to see if the path is right? Commented Aug 11, 2014 at 15:55
  • What's inside the php_scripts/conn.php file? It's getting included, it just has something so wrong that it is causing a 500 error. Commented Aug 11, 2014 at 16:07

1 Answer 1

1

try the magic constat "DIR":

require_once(__DIR__."/../../php_scripts/conn.php");
Sign up to request clarification or add additional context in comments.

Comments

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.