Topic on Project:Support desk

[RESOLVED] Having trouble running update.php

32
Gobadgers77 (talkcontribs)

Okay so here's the situation. My Mediawiki was being spammed by spambots so I put in ConfirmAccount extension in order to let the bureaucrats confirm all account creations by the people I knew were actual users (it's a small time wiki). I installed the plugin but when I tried to run update.php I get this:

-bash-3.2$ php maintenance/update.php
Content-type: text/html

You are using PHP version 4.4.9 but MediaWiki needs PHP 5.3.2 or higher. ABORTING.
Check if you have a newer php executable with a different name, such as php5.
-bash-3.2$ 

I figured I needed to update to the next version of MediaWiki and PHP so I did install MediaWiki 1.20, but my hosting provider (Godaddy) only has PHP 5.3.14, and when I run update.php now it still gives me that same error saying I'm using PHP version 4.4.9 (which is false because when I go to the Special:Version page on my MW it says that I'm using PHP 5.3.14).

Any way to fix this? I can't do anything on my MW until it is fixed.

88.130.95.173 (talkcontribs)

Accessing your webserver with a browser and with a shell are two different things. When you access your webserver with a browser, you can see one PHP version, while on the shell you see another one.

In your case the command "php" executes PHP 4.4.9. The text you got as a response basically tells the solution: Execute the updater with PHP 5.3. All you need to know is the command to execute the PHP 5.3 files on the shell. This might be php5 or php53. So try

php5 maintenance/update.php

or

 php53 maintenance/update.php

to run the updater.

Gobadgers77 (talkcontribs)

Thanks for the reply. I tried your suggestion, and now it says

-bash-3.2$ php5 maintenance/update.php
-bash: php5: command not found
-bash-3.2$ php53 maintenance/update.php
-bash: php53: command not found

Is it because I have a Mac and I'm trying to use Terminal application to access with ssh? Is it possibly a totally different command for the Terminal application?

88.130.95.173 (talkcontribs)

No, not that I know of. Since with the shell you are not accessing your local Mac, but you are accessing the server, the command you need to know depends on what is available on the server. I would suggest asking Godaddy what the command is to run PHP 5.3 on the shell.

83.226.84.183 (talkcontribs)

Specifying which php.ini to use might help, it did for me (I had exactly the same problem), ie php -c /path/to/php.ini update.php

Gobadgers77 (talkcontribs)

I'm kind of an amateur at this stuff. How do I find out that information?

88.130.119.203 (talkcontribs)

You don't even know, if there is another php.ini to define in your case and -if there was one- if using that one would help; chances are it does not at all.

Ask Godaddy what the command is to run PHP 5.3 on the shell.

Lieutenant S. Reznov (talkcontribs)

I've found running maintenance scripts with GoDaddy to be extremely difficult. The cron jobs default to php5, and I think it specifies a file path, but it doesn't work at all. I tried:

cd /path/to/wiki/maintenance/
php update.php

instead of php5. That worked. It seems that MediaWiki 1.20 requires php 5 to run the maintenance script.

Are you on a Windows or Linux server? It makes a small difference with the file path since UNIX OSs don't start with a drive.

Try taking your absolute hosting path (available on the hosting server control panel home page), adding the server root (should be /html/), followed by the file path from the root of your server to the wiki maintenance script, and using that to run the script. It might be something like:

/home/file/path/to/html/subDomainFolder/w/maintenance/update.php

As for the php instruction before it, try php or php5.

The php.ini file should be in the root folder (/html/) of your server. You can try adding the absolute hosting path to it. Possibly something like:

/home/file/path/to/html/php5.ini

I think php5 uses a different .ini file.

If you've used Terminal before, the command line on Linux is fairly similar to Mac OS.

Another thing that maintenance scripts need is for

register_arc_argv

to be enabled.

I don't know if this was part of the problem here, but I've noticed that the autoinstallers from webhosts often can cause problems. I put a notice on the installation instructions page recently because we had a problem with one.|07:32, 21 January 2013 (UTC)

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Gobadgers77 (talkcontribs)

Thanks for your replies. Godaddy responded with an "answer" to my queries, and this is what they said.

I understand that you are concerned about the PHP version on your hosting account. Your hosting account is using PHP 5.3. This does not necessarily mean that your MediaWiki scripting is using the same version. We do not support the inner functionality of third party applications and have no control over what PHP version the application is using. I recommend that you review this issue with MediaWiki support or do some research on your favorite search engine or support forum. You will need to review your question about the specific command with a support forum as well. We are not able to provide commands for third party applications.

I've asked them what the command is before, but this is the first time they said anything in response to it. They have nothing and told me to look elsewhere, which I have been, I just haven't found a solution that works.

@Inquisitor Ehrenstein:

I have a Windows server. I used the absolute hosting path to try to run the update.php, and it said the same thing as before.

-bash-3.2$ php /home/content/79/9779079/html/wiki/maintenance/update.php  
Content-type: text/html

You are using PHP version 4.4.9 but MediaWiki needs PHP 5.3.2 or higher. ABORTING.
Check if you have a newer php executable with a different name, such as php5.

I tried that with the commands php, php5, and php53.

Godaddy definitely says I'm running PHP 5.3 on my server but every time I try to do anything, it says I have 4.4.9. I'm so lost right now. Is there a way I should be using shell to install PHP onto my server?

88.130.74.218 (talkcontribs)

Hi Gobadgers,

this is no MediaWiki problem. Obviously the support did not understand what you want. However, no need to write them that.

All you need to know is the command, with which you can run PHP 5.3 on the shell. This question does not depend on a special PHP script, which you want to run with that command. So ask them again and do not mention a special application at all.

So maybe you can write the support something like:

I have a PHP script, which I want to execute from the shell. You say PHP 5.3 is available on my account. That is great! What is the shell command to run a PHP script with PHP 5.3?

And then see what they write. I think asking that way is really idiot-proof. Tell us what they answer (I fear I already have an idea...).

Gobadgers77 (talkcontribs)

Thank you. I said something like what you said, and they finally gave me a somewhat useful response. Here it is, if this helps you to help me:

Thank you for your response. If you're running a phpinfo command via SSH, the PHP version given will be the PHP version of the parent server, not your hosting plan. Anything running on your hosting plan would be PHP 5.3. So there wouldn't be a shell command to force PHP 5.3 within SSH. If you're seeing an error when attempting to run the shell command provided by MediaWiki, please provide that information so that we can test further.

MarkAHershberger (talkcontribs)

It sounds like you just need to give them the error message. From above:

-bash-3.2$ php /home/content/79/9779079/html/wiki/maintenance/update.php  
Content-type: text/html

You are using PHP version 4.4.9 but MediaWiki needs PHP 5.3.2 or higher. ABORTING.
Check if you have a newer php executable with a different name, such as php5.

If you write them back with that, what do they do?

88.130.69.150 (talkcontribs)

I have just googled that problem for you.

Here I found one workaround, of which the author says it would be working for him:

cd /home/content/79/9779079/html/wiki/
/usr/local/php5/bin/php maintenance/update.php

No idea, if it works on your hosting package as well.

Another idea: Why do you not run the web updater? You can reach it with your browser by navigating to http://URL-of-your-wiki/mw-config. Or does that in the end internally run a shell command as well?

This post was posted by 88.130.69.150, but signed as 88.130.117.206.

Gobadgers77 (talkcontribs)

Okay @MarkAHershberger here is what they said:

Thank you for your reply. Due to the nature of shared hosting, SSH will not be able to access PHP 5.3 as SSH runs off the parent server. You would need to upgrade your application using a different method other than SSH. Otherwise, if you require this ability, you would need to use a virtual private or dedicated server.

It appears that I can't do what I'm supposed to do do on shell. That seems strange because I figure a large company such as Godaddy would have many MediaWiki on their servers.

@88.130.117.206

I'll try to do that, thanks.

Edit: 88.130.117.206 I don't know who you are but you saved my MediaWiki with that web uploader. I could swear I tried it before I came here for help and it didn't work. This time it did and everything is working perfectly fine. Thank you so much. I'll try to install my extension (the reason I was upgrading to 1.20.2) and hopefully everything will work fine.

Edit #2: Okay now the extension I'm trying to install (Confirm Account http://www.mediawiki.org/wiki/Extension:ConfirmAccount) is requiring me to run update.php again which, obviously, I cannot do. Do you guys know of any work arounds? An extension such as this is vital to my MW because of the flood of spam robots we get editing pages.

88.130.69.150 (talkcontribs)

So Godaddy tells you that you should either buy a more expensive package from them or do the update not via the shell (but via the web updater). Interesting that they are unable to provide you with a current PHP version on the shell. 4.4.9 is like stone age.

I am glad that my comment with the web updater helped you! :-)

The page Extension:ConfirmAccount tells you to run update.php, but ... does the web updater not do the same? (I mean that is exactly what you did instead of running it from the shell when you did the upgrade.)

Check your wiki before you run the updater and note where/if you see a database error from ConfirmAccount (probably when you try to create an account). Then run the web updater and see if the error is gone...

Gobadgers77 (talkcontribs)

Well when I run the web updater, this error pops up:

Fatal error: Class 'ConfirmAccountUISetup' not found in /home/content/79/9779079/html/wiki/extensions/ConfirmAccount/ConfirmAccount.php on line 42

This is what line 42 is in that file:

ConfirmAccountUISetup::defineResourceModules( $wgResourceModules );

MarkAHershberger (talkcontribs)

Looks like the autoloader doesn't know about the ConfirmAccountUISetup. Let me check...

MarkAHershberger (talkcontribs)

Got that error fixed, but now the updater is saying

Call to undefined method MysqlUpdater::dropExtensionIndex() 

Hang on while I check this out.

EczaWiki (talkcontribs)

I also have the same problem.

Call to undefined method MysqlUpdater::dropExtensionIndex() 

I couldn't find any solution. Hope someone does.

2602:306:C5AE:1E30:5D0D:2407:D8E1:562A (talkcontribs)

Still no solution? I'm having this same problem.

88.130.77.56 (talkcontribs)

I am not Godaddy, I don't know what they do. Maybe they have become better, maybe they haven't; I don't know.

MarkAHershberger (talkcontribs)

Actually, I was testing 1.19. It may work on your version. Try adding this line just before the current line 42:

require( __DIR__ . '/frontend/ConfirmAccountUI.setup.php' );
MarkAHershberger (talkcontribs)

yep, tested the above line on 1.20 and it worked.

Gobadgers77 (talkcontribs)

That worked. Thank you all so much, you're all great help.

24.210.245.66 (talkcontribs)

Worked for me too, thank you!

181.168.192.110 (talkcontribs)

Hi, I'm having a similar problem running SSH commands in my Go Daddy Hosting Accout. I am on a Linux shared server, and when I put

php indexer.php info I get something like Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION

When I put either php5 indexer.php info or php53 indexer.php info , it just says "Command not found".

I called Go Daddy and they said those commands are not going to work on a shared hosting account, which doesn't makes sense to me. I'm trying to run this commands to make common process that has to be done once in a while in Stores based on Magento, which is the framework I'm using.

Any ideas about how can I solve this? Thanks!

Thanks!

88.130.119.131 (talkcontribs)

Hi!

Godaddy does not offer PHP 5.3 on the shell. That basically means: You cannot use the shell to execute PHP commands with your Godaddy account. You can call that bad support, but that's the way it is with Godaddy.

I don't know how other applications (like Magento) work, but as far as MediaWiki is concerned you can still use the web updater to update your site (which then works without the shell).

86.135.248.99 (talkcontribs)

please fix the issue please

88.130.87.150 (talkcontribs)

Please go away from Godaddy, please!

Honestly: If you had read the thread you would have noticed that this is not a problem in MediaWiki...

86.173.52.65 (talkcontribs)

Issue has been fixed in extension localisation update because I found it fixed the issue

Reply to "[RESOLVED] Having trouble running update.php"