The MU forums have moved to WordPress.org

Warning: fopen() [function.fopen]: Unable to access wp-config.php (7 posts)

  1. anjovis
    Member
    Posted 16 years ago #

    Installation woes :(
    Did it by the book (chmod and all) but the script fails to create the wp-config.php on line 315 (and so fails on subsequent lines as well).

    It says (desensitized) : Warning: fopen() [function.fopen]: Unable to access wp-config.php in /www/docs/example.com/index-install.php on line 315

    and so on and so on.

    No other error messages at all (so it's not a permission issue, I can su to the webserver user and create files that way in the directory). mod_rewrite is enabled.

    And since I cannot create it manually (or can I? Please!?) I'm stuck. Very stuck. No amount of chgrp, chmod, chown on files or directories makes this error go away and I cannot find anyone with the same problem. Please could we have a manual install option too, instead of just "use the installer, period"

    php 5.1.4, apache 2.2.3, solaris 10, mysql 5 on a different server.

    On a side note, I installed the same wordpress package on my windows laptop without a hitch. Might I be able to just move the wp-config.php from my laptop to the server, adjusting accordingly, and create the database tables from a mysql-dump from my laptop? Would that make it ok?

  2. lunabyte
    Member
    Posted 16 years ago #

    Looks like permission to use fopen is denied in php.ini.

    All ya gotta do it edit it and turn it on, then restart apache.

  3. anjovis
    Member
    Posted 16 years ago #

    fopen is fine and working on all my other virtual hosts too, but only when the file in question already exists. (I tested this specially since you were kind enough to answer)

    BUT I googled, and at least on php 4 it seems there is a bug which affects solaris 8, and so might affect later versions as well. The bug is such that fopen fails to create a file because of some path variable that is missing on certain operating systems. So I guess that's whats going on here, although I wonder how come no-one has noticed it before. I have a handfull of vhosts on this server, all using php.

    But, I'll keep diggin and if I find a workaround, I will report it should someone else get stuck on this issue.

  4. anjovis
    Member
    Posted 16 years ago #

    FIXED!
    the bug I mentioned must be worked around by prepending the current directory onto the filename; ie on line 315 fopen('wp-content.php','w') must be changed to fopen('./wp-content.php','w')

    Same goes for .htaccess as well, on line 121 of index-install.php

  5. SteveAtty
    Member
    Posted 16 years ago #

    But that's the same file in the same directory!

  6. lunabyte
    Member
    Posted 16 years ago #

    That's pretty crazy right there.

    Have you considered an updated version of php?

    You do know that PHP4 is being discontinued, right?

  7. anjovis
    Member
    Posted 16 years ago #

    Yes, as I stated in my original post, our php version is 5.1.4 (and it cannot be updated since an update to 5.2 broke moodle... and we can't let that happen again :/)

    I am aware that that's a stupid bug, but now we know the workaround, so that's good. It's probably something that just happens on solaris + php installations.

About this Topic