• 15

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

realpath returns empty string

I use MediaWiki but there is an error. I found it in the files. There is line with this code:

$IP = realpath( '.' );

But $IP returns an empty string, so the path to the files in the system is not working. (for example if $IP would be . or E:/path_to_wwwroot it works). How can I solve the problem. Is it possible that my provider blocked access to realpath?


Source: http://php.net/manual/en/function.realpath.php

Note: The running script must have executable permissions on all directories in the hierarchy, otherwise realpath() will return FALSE.

So your web server should have access also to pre-webroot directories.

  • 15
Reply Report
      • 1
    • I ran into this when I was running the "portable" PHP+NGINX app WT-NMP and my sandboxed PHP app was referencing libraries outside the path I specified for open_basedir in php.ini. I solved it by also adding my library path to open_basedir (using the ";" delimiter on Windows).
    • Wow, it solved the problem! Many thanks. I needed to change the read permission from my subdomain map. Thanks!!!

I am currently experiencing this result when running PHP from command line, but not within an HTTP request. Got to be config or $_SERVER settings somewhere, will update if I find the fix.

  • 0
Reply Report

The path I was creating didn't exist, make always sure that it's well formed.

This is the path I was using:

realpath(MY_PATH . '../other_path');

Where MY_PATH didn't have a trailing /.

  • 0
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions