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 6859015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:13:53+00:00 2026-05-27T02:13:53+00:00

Even if safe mode is activated on the server, if script file, target file

  • 0

Even if safe mode is activated on the server, if script file, target file and parent folder is owned by the same user, fopen should work without any problem. Any ideas why this is happening?
The files have 755 permission.
Thank you for your time and effort.

$filename="file.html";
echo "Current User: ".get_current_user()."; UID: ".getmyuid()."; GID: ".getmygid()."<br/>";
echo "Current PID: ". getmypid() . "<br/>";
echo "Parent folder owner: ". fileowner(".") . "<br/>";
echo "$filename owner: " . fileowner($filename) . "<br/>";
echo "Current folder is writable: " . is_writable($filename);

OUTPUT:

Current User: vnnamp; UID: 32024; GID: 32026
Parent folder owner: 32024
file.html owner: 32024
Current folder is writable: false

  • 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-05-27T02:13:54+00:00Added an answer on May 27, 2026 at 2:13 am

    Are you sure your script is operating in the correct directory?

    If it is not then the file name you pass it likely doesn’t exist and that would be why is_writable() returns false. Use getcwd() to print out the directory the script is operating in (can set it with chdir()) or use absolute file names.

    EDIT: Just to summarize the discussion below:

    • Try absolute path name: Nope
    • Check open-basedir in php.ini and httpd.conf: Nope
    • Try prefixing path with $_SERVER['DOCUMENT_ROOT']: Nope
    • getmyuid() returns script file owner not process owner
      check mismatch file owner and process user with
      posix_getpwuid(posix_geteuid()): Yes, cause of the problem
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I it safe to place config.php in the root of your website even though
My code mkdir(/some/absolute/path,0777); and mkdir(relative/path, 0777); is not working, safe mode is turned off,
My PHP script that uploads a file, cannot do so in directories at a
Is this code considered thread safe even though multiple threads may be polling the
I have safe mode turned off in my MongoDB database because none of the
When using Aptana with PHP 5.2.3 in debug mode (using thread safe XDebug 2.1.0
Even though I always strive for complete validation these days, I often wonder if
Even though I have a robust and fast computer (Pentium Dual Core 2.0 with
Even when BorderStyle is set to 0, it is possible to force a window
Even after all the hotfixes and updates that are supposed to fix this, my

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.