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

  • SEARCH
  • Home
  • 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 9070641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:43:56+00:00 2026-06-16T17:43:56+00:00

The following script fails if line #6 (.include …) is uncommented – no matter

  • 0

The following script fails if line #6 (.include …) is uncommented – no matter what the content of the file “somefile.php” is. Even for a 0-byte (empty) file. I was trying to move such functions and create a “utils.php” library, is that a big no-no in the PHP world? Error_log is empty. I am using PHP 5.2.17 on Linux 2.6.32. Thank you.

<?php // File: index.php
error_reporting (E_ALL);
ini_set ('display_errors', 1);

//Uncomment the following line and the script fails
//.include "somefile.php";

function imageToBrowser ($pseudonym, $filePath) {
        header("Pragma: public");
        header("Expires: 0");
        header('Cache-Control: no-store, no-cache, must-revalidate');
        header('Cache-Control: pre-check=0, post-check=0, max-age=0', false);
        header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
        header("Content-Length: ".(string)(filesize($filePath)));
        header('Content-Type: application/x-download');
        header('Content-Disposition: attachment; filename="'.$pseudonym.'.png"');
        header('Content-Transfer-Encoding: binary');

        if ($file = fopen($filePath, 'rb')) {
                while(!feof($file) and (connection_status()==0)) {
                        print(fread($file, filesize($filePath)));
                        flush();
                }
                fclose($file);
}}

if (isset($_GET['showImage']) && ($imageMask = $_GET['showImage'])) {
        imageToBrowser ($imageMask, 'Clear64.png'); // Use any .png file in $cwd
} else {
        echo "<html><body><center>\n";
        echo "<img border='0' src=\"{$_SERVER['PHP_SELF']}?showImage=365\" alt=\"Missing Image\"/>\n";
        echo "</center></body></html>";
}
?>
  • 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. Editorial Team
    Editorial Team
    2026-06-16T17:43:57+00:00Added an answer on June 16, 2026 at 5:43 pm

    There should be no . before include. Dot is a concatenation operator in PHP and irrelevant here.

    Also please note that your ini_set ('display_errors', 1); statement won’t help with parse errors for obvious reasons. Better set your settings in php.ini or web-server config.

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

Sidebar

Related Questions

The following script creates symlinks as expected, but the original file can never be
I have the following line in my script, building a string based on news
I'm using the following script to refresh my iframe. In case the refresh fails,
On an Android 2.2 emulator, loading a blank page with the following script fails:
How to capture LINE NUMBER when any of your code fails in SSIS Script
I have the following script (modified to remove any private information). -- This line
I'm running a script fine from the command line, but it fails when put
Following Script isn't working in CHROME browser, IE is Fine. I've changed opener.document ...
The following script: cls function test_me([string]$testVar, $my_array) { Write-Host $testVar } $test_array = a,b
The following script was recommended to use a List Page to show a Google

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.