Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 184159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:14:35+00:00 2026-05-11T15:14:35+00:00

Before the PHP Version update I used to be able to include files as

  • 0

Before the PHP Version update I used to be able to include files as following without specifying the document root:

<?php include '/absolute/path/to/files/file1.php'; ?> 

However I now have to include the same file as following:

<?php include $_SERVER['DOCUMENT_ROOT'].'/absolute/path/to/files/file1.php'; ?> 

What php.ini setting could have overridden the former behaviour?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:14:35+00:00Added an answer on May 11, 2026 at 3:14 pm

    Including an absolute path should be working the same way straight through PHP 5.2.9 (haven’t tried 5.3, but this shouldn’t change). Since you’re specifying an absolute path, the include_path directive has no bearing.

    Can you provide some more information? What PHP version, platform, and the error you get back from include would be a great start.

    Linux: RHEL 5 PHP: Version PHP 5.2.9 Error Messages I get are: PHP Warning: require(/conf/common.php): failed to open stream: No such file or directory in /var/www/vhosts/DOMAIN/httpdocs/tell-a-friend-fns.php on line 63 PHP Fatal error: require(): Failed opening required ‘/conf/common.php’ (include_path=’.:/usr/share/pear:/usr/lib/php:/tmp’) in /var/www/vhosts/DOMAIN/httpdocs/tell-a-friend-fns.php on line 63

    Okay, it looks like your application is living in /var/www/vhosts/DOMAIN, and you’re looking for /conf/common.php, right? I don’t know if your file is actually in /conf/ or if it’s in /var/www/vhosts/DOMAIN/conf/ (I assume the latter, with the information given). If it’s in /conf/, then make sure that your Web server user can read that directory. If not, change your include to /var/www/vhosts/DOMAIN/httpdocs/conf/common.php.

    Better yet, you might be able to do include '../conf/common.php, depending on where common.php lives in relation to your main script for the requested page.

    Remember that any path given with a leading ‘/’ is absolute in relation to the file system, not the Web server document root. Any path given without a ‘/’ is assumed to be a relative path, relative to your executing script (not the current file). My guess is that prepending $_SERVER[‘DOCUMENT_ROOT’] to your path is changing the absolute path to a relative path. I have no idea why an absolute path would act as a relative path pre-upgrade, unless you were operating in a jailed environment (common with virtual hosts) which got removed during the upgrade.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've never used php before and am trying to connect to a SQL Server
I'm just starting out in Java, and only ever used PHP before - finding
As you know, the @ characters before a php istruction suppress every eventual warning,
Possible Duplicate: PHP htmlentities() on input before DB insert, instead of on output For
Before I start, I should let you know that I'm hardly experienced in PHP.
I know that PHP is compiled to byte code before it is run on
Before moving to PDO, I created SQL queries in PHP by concatenating strings. If
I've implemented more complex AJAX before with javascript and PHP, but for some reason
I need some advice before I start. My PHP Skills are only 3 months
Can you run some script before the uploading of a file starts in php?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.