Page MenuHomePhabricator

Warning: main(includes/SkinTemplate.php): failed to open stream
Closed, InvalidPublic

Description

Author: misterredtape

Description:
I can run Wikipedia successfully on my own Windows XP PC (PHP 4.3.2, Apache
2.0.47), but not on my host's Linux server (same PHP).

URL of wiki is here:
http://tfs.zeromass.org/wiki/index.php?title=Main_Page

I think it may be this bug:
http://rocketsupport.com/index.php?page=index_v2&id=340&c=15
http://bugs.php.net/bug.php?id=24053

Thanks.


Version: 1.4.x
Severity: normal
OS: Linux
Platform: Other
URL: http://tfs.zeromass.org/wiki/index.php?title=Main_Page

Details

Reference
bz2265

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:31 PM
bzimport set Reference to bz2265.
bzimport added a subscriber: Unknown Object (MLST).

$IP is set incorrectly in your LocalSettings.php. Try setting it to the full path.

Was that file created as-is from the installer on that server, or did you manually modify or create it?

  • Bug 2266 has been marked as a duplicate of this bug. ***

misterredtape wrote:

Note that 1.3 works fine on the same site and on my home system:
http://yotz.zeromass.org/wiki/

This version works with the same $IP set.

I have tried the following:
"."
"/absolute/path/to/wiki/dir"
"/relative/path/from/subdomain/root"

None of these appear to work.

I have set it myself. The installer sets it incorrectly.

What did the installer set it to? Can you confirm the path is wrong? How is it wrong? How did you determine
this?

Have you confirmed that you're providing the right path? How have you confirmed it?

Can you confirm that all elements in the path are readable?

misterredtape wrote:

I confirmed the installation's mistake by just firing up the wiki. No link would
connect (would connect to an incorrect subdir or up to the main domain).

I have set my $IP to: "/home/zeromas/public_html/tfs/wiki"
as per the instructions at:
http://rocketsupport.com/index.php?page=index_v2&id=25&c=10
...for my host, I have the directory correct. I have also checked it using "cd"
at unix prompt.

As far as readable goes, you can fire up any file in:
http://tfs.zeromass.org/wiki/skins/

It doesn't let you list the content of the directory, but only because I have
"Options -Indexes" in .htaccess on. Yes, I've tried deleting the .htaccess file
and accessing the wiki, too.

I am using $IP="." for my home system and it works fine. This $IP has worked
fine for me for every other version so far.

Thanks Brion.

*What* did the installer set it to that it didn't work? What exactly failed? Please be specific,
providing exact quotes from LocalSettings.php and error output.

This error message indicates that the $IP path currently has a missing initial slash:
Warning: dir(home/zeromas/public_html/tfs/wiki/skins): failed to open dir: No such file or directory in /
home/zeromas/public_html/tfs/wiki/includes/Skin.php on line 22

Can you confirm?

"would connect to an incorrect subdir or up to the main domain" sounds like your server has badly
configured virtual hosts that are reporting the wrong path back to the PHP script. Please confirm exactly
what the paths were set to and exactly what you expected in contrast, and exactly what happened. Confirm
the exact URI you were sent to and the detected value of $wgServer.

river wrote:

sev => normal

can you also confirm that the required files are readable by the user
the web server runs as, as well as the user you are logged in with?
e.g. that "includes" is at least mode 711, rather than 700?

misterredtape wrote:

My server's virtual hosts are fine. So are hostrocket's. The installation sets
these (inappropriate) values on a Windows XP machine:

$IP = "C:\\DRIVES\\IMAGO\\PUB\\public_html\\www\\test";
$wgScriptPath = "/phpiselsewhere/php.exe";

Which gives an error when loading up the wiki:

Security Alert! The PHP CGI cannot be accessed directly.

This PHP CGI binary was compiled with force-cgi-redirect enabled. This means
that a page will only be served up if the REDIRECT_STATUS CGI variable is set,
e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual page for
CGI security.

For more information about changing this behaviour or re-enabling this
webserver, consult the installation file that came with this distribution, or

visit the manual page.

So, I change the above to the following, which has worked up to version 1.3
without issues:
$IP=".";
$wgScriptPath = "/wiki";

Now, this configuration works fine on my windows XP machine running apache. I
can access it through:
http://subdomain.localhost/wiki
... just fine.

When I upload this installation over to my hostrocket server (zeromass.org) it
presents the error seen:
http://tfs.zeromass.org/wiki/

So, the question is, what exactly is incorrectly set with my $IP and
$wgScriptPath? Setting it to something relative like "." does not work, nor does
using absolute path.

Thanks.

misterredtape wrote:

Hello,

Original file attributes are standard for a website (644). Changing this to 777
does not yield any changes...

Thanks.

river wrote:

your $IP appears to be separated via a semicolon (;). on Unix a colon
(:) is used. please try changing this.

The first problem is that your PHP configuration on your Windows machine is very unusual and appears to introduce
incorrect values that confuse the installation there.

The second problem is that you're copying the configuration file from your Windows machine to a Unix server; this will
cause a number of lines in the config file to be incorrect.

Find the line something like this:

ini_set( "include_path", ".;$IP;$IP/includes;$IP/languages" );

and change it to:

ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages" );

Change the semicolons to colons.

Having $IP set to "." is not expected nor supported, and is very likely to cause you trouble. You should use the full
path.

misterredtape wrote:

Brion,

Changing the semicolons to colons did the trick.
http://tfs.zeromass.org/wiki

Thanks for being so patient...

river wrote:

sev => normal
component => installation
RESOLVED INVALID