Jump to content

Topic on Project:Support desk

[RESOLVED] update.php prohibited

15
90.197.7.67 (talkcontribs)

Hello folks,

I'm new to mediawiki and I have to say I'm very impressed. It was exactly what I was looking for. However, I'm in a bit of a pickle.

I tried to install an extension, the ConfirmAccount one. The installation goes fine but when I try and access update.php I get the following message:


Forbidden

You don't have permission to access /w/maintenance/update.php on this server.

Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 Server at localhost Port 8888


What on earth is going on? The index files work, I can add members, pages etc. But I just can't access anything in the maintenance folder despite the fact every file is read+write for admin.

I'm on Mac OS X, on a MAMP platform. My mediawiki version is 1.16.5, PHP version 5.3.5 (apache2handler) and MySQL 5.5.9

Where am I going wrong?

90.197.7.67 (talkcontribs)

P.S. When I check Apache's error log, this is what I get:

[Mon Jun 20 22:59:45 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Jun 20 22:59:45 2011] [notice] Digest: done
[Mon Jun 20 22:59:45 2011] [notice] Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 configured -- resuming normal operations
[Mon Jun 20 23:00:05 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/
[Mon Jun 20 23:00:12 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
[Mon Jun 20 23:08:35 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
[Mon Jun 20 23:08:36 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
[Mon Jun 20 23:08:37 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
[Mon Jun 20 23:09:07 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
[Mon Jun 20 23:16:10 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
[Mon Jun 20 23:28:34 2011] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/w/maintenance/update.php
Krinkle (talkcontribs)

update.php is a maintenance script, not a browser script. Execute it from your command-line interface. See also update.php

From your output I assume you're on a Mac:

  1. Go to Application > Utilities > Terminal
  2. type "cd " (including a space) and from the Finder drag the folder into this window in which you have mediawiki installed. The result will be something like this:
    $ cd /Applications/MAMP/htdocs/w/ 
    . Press Return/Enter
  3. type "cd maintenance" and press Enter again. (cd = "change directory")
  4. Last but not least to execually perform the update, execute "php update.php"
90.197.7.67 (talkcontribs)

Ahh, I see. Well, I do all of that but now I get this message on terminal.


x-MacBook:maintenance x$ php update.php

MediaWiki 1.16.5 Updater

DB connection error: No such file or directory (localhost)


SQL and Apache servers are running.

Bawolff (talkcontribs)

I remember hearing about an issue once where mysql does weird crap when it sees localhost. Try changing your db server to 127.0.0.1 instead.

90.197.7.67 (talkcontribs)

Do you know how I would go about doing that?

95.167.125.206 (talkcontribs)

Looks like you have to setup a $wgServer variable in LocalSettings.php.

Substitute
$wgDBserver = "localhost";
with
$wgDBserver = "127.0.0.1";

90.197.7.67 (talkcontribs)

Great - and this is all I would have to do? My ports are set to 8888 for Apache and 8889 for MySQL. That stays the same?

90.197.7.67 (talkcontribs)

Okay, I've done as you said. However, I get this error message now:

Sorry! This site is experiencing technical difficulties. Try waiting a few minutes and reloading.

(Can't contact the database server: Can't connect to MySQL server on '127.0.0.1' (61) (127.0.0.1))

90.197.7.67 (talkcontribs)

Managed to fix it by changing ports.

Bawolff (talkcontribs)

Out of curiosity, did that actually fix the update.php issue. I just remember hearing the localhost vs 127.0.0.1 thing once. I have no idea if that actually had anything to do with your issue or not, so I'm kind of curious if it actually fixed the problem, or just did nothing.

90.197.7.67 (talkcontribs)

Ultimately no. I ran update.php and I had several problems with table formation. I'm not an expert in SQL or I deleted the tables the update.php installed and got rid of the installation.

141.5.4.127 (talkcontribs)

Error 1: MediaWiki 1.20.2 Updater DB connection error: No such file or directory (localhost)

Error 2: MediaWiki 1.20.2 Updater DB connection error: Connection refused (127.0.0.1)


As I had the same problem, and figured out a way to get it to work, I'll post the solution here, even though it's a dead thread: When setting up mediawiki, it automatically generates a LocalSettings.php file in the top most mediaWiki directory, where index.php is located. The automatic setup correctly added the port (8888) to the Apache address in this LocalSettings.php: $wgServer = "http://localhost:8888";

But the port (8889) was not added to the database address: $wgDBserver = "localhost";

For me it worked, when I just changed this line to: $wgDBserver = "localhost:8889";

Localhost or 127.0.0.1 did not make a difference for me

Ciencia Al Poder (talkcontribs)

Thanks for sharing!

141.26.71.136 (talkcontribs)

Error 1: MediaWiki 1.20.2 Updater DB connection error: No such file or directory (localhost)
Error 2: MediaWiki 1.20.2 Updater DB connection error: Connection refused (127.0.0.1)

Same erros occured, when I tried to update from version 1.19 to 1.20.3. My MediaWiki is running on my local Macbook using XAMPP. After asking google for this error, I found this thread. Since the error message is not very informative, the source of the problem is hard to find. So I want to share my solution:

In my case, the problem was the mysql command line tool. If I tried to connect via terminal, I got an error message, that mysql can't connect through the socket "/tmp/mysql.sock".
<< mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

So I looked for the MySQL configuration file "my.conf" inside the directory "XAMPP/etc". Client and server socket was configured as "XAMPP/xamppfiles/var/mysql/mysql.sock". After changing this to "/tmp/mysql.sock", the mysql command line tool works fine and lo and behold, also the "update.php" of the MediaWiki runs successfully to the end.

Perhaps, this helps other user, who'll find this thread like me. Best regards. Andi

Reply to "[RESOLVED] update.php prohibited"