Firefox PHP

Problems Moving to New Server

Posted by Robert Angle 
Problems Moving to New Server
April 12, 2013 02:40AM
Since my previous host shut me down, I got myself a nice VPS server and am moving my sites over to it. However, I ran into a snag with Phorum. I get the following image errors (see attachment), plus it seems like 1/2 of all user avatars are broken.

In the Embed Images Mod, the Download test fails with the following message....

Quote

This check tries to download the Google homepage via the http_get API. If the platform support check returns "OK", but this check returns "NOT OK", then the hosting platform might be blocking outgoing HTTP connections from the webserver.

Please contact your hosting provider if this check returns "NOT OK".

I have access to WHM and Shell - could you tell me what I need to do to enable outgoing HTTP, getimagesize, getaddrinfo etc?


Robert Angle
Phorum lover, nothing more.
Ruminations


Re: Problems Moving to New Server
April 12, 2013 04:26AM
WHM allows you to configure the firewall, eh? Allow outgoing access through port 80 / http there.
And why the getaddrinfo fails - no idea, whats the url of the image in question? if so, can you get to that image through the shell when trying to download it for example with wget from the server?


Thomas Seifert
Re: Problems Moving to New Server
April 12, 2013 08:15AM
Here is an attachment with the debug enabled. I looked through the Firewall in WHM and it appears port 80 is allowing incoming and outgoing connections. I will attempt the shell thing with wget as soon as I read up on how to do it properly.


Robert Angle
Phorum lover, nothing more.
Ruminations


Re: Problems Moving to New Server
April 12, 2013 08:40AM
Quote
Thomas Seifert
if so, can you get to that image through the shell when trying to download it for example with wget from the server?

Yes this was successful.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 12, 2013 09:12AM
According to the debug info in the screenshot, it looks like everything works until it is time to actually display the image.

Nevermind.

Error loading file: Connection to server failed (php_network_getaddresses: getaddrinfo failed: Name or service not known)

Creating thumbnail failed: Running getimagesize() on the image data failed


Robert Angle
Phorum lover, nothing more.
Ruminations



Edited 1 time(s). Last edit at 04/12/2013 09:31AM by Robert Angle.
Re: Problems Moving to New Server
April 12, 2013 10:00AM
Okay, Ill recant a little bit. Some of those images were supposed to be links to a directory on my server that I did not move over yet.

However, all avatars are still broken, plus anything I upload as an attachment, and any image I link to.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 12, 2013 10:13AM
When I disable the Embed_Images module, the links are displayed as so...

[www.jwtalk.net]

And the image is broken.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 12, 2013 11:12AM
are you using the store files on disk module?


Thomas Seifert
Re: Problems Moving to New Server
April 12, 2013 11:15AM
Quote
Thomas Seifert
are you using the store files on disk module?

Yes.

But im pretty sure i moved those directories too.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 12, 2013 11:16AM
Make sure of that - and also that they are reachable under the path given in the settings or fix the path there if the directory structure changed.


Thomas Seifert
Re: Problems Moving to New Server
April 13, 2013 09:03AM
Quote
Thomas Seifert
Make sure of that - and also that they are reachable under the path given in the settings or fix the path there if the directory structure changed.

So far nothing.

In moving to the new server, I backed up the database using cPanel backups. FTP'ed it to my new server and then used shell to create the new database (because it was too large to do via cPanel or MyPHPadmin). This was successful. People can login and post freely at the new location.

However, no images that are provided by phorum scripts are working. Avatars are broken as well as anything in [img] tags, and all image attachments that are in the message bodies using Mod:Embed_Attachments.

Even now, if I create a NEW post, and try to display an image using any of the 3 methods above, they are broken as indicated by the screen caps I provided above. The debug output tells me that it fetches the URL appropriately, creates a thumbnail successfully, but then when called to display the image it fails.

I am using Mod:Store_Files_to_Disk and have copied the entire directory structure.

The PATHS may have changed, but in both Mod:Store_Files_to_Disk and Mod:Embed_Images these paths are releative anyway, namely:

Where to store files: repository
Cached directory for scaled images: repository/Scaled_Cache

What DID change is that I gave this "domain" it's own account on the new server instead of it being a subdomain of another account on my old server, ie...

was: /home/rlangle/jwtalk/forum
now: /home/jwtalk/forum

So I realize I must have botched something, but all the data is there. It's just a matter of getting it fixed right.


Robert Angle
Phorum lover, nothing more.
Ruminations



Edited 1 time(s). Last edit at 04/13/2013 09:04AM by Robert Angle.
Re: Problems Moving to New Server
April 13, 2013 09:29AM
did the php versions change between the servers?


Thomas Seifert
Re: Problems Moving to New Server
April 13, 2013 09:32AM
Old server: 5.2.17
New server: 5.3.23


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 13, 2013 09:34AM
if it would be only the image part I'd have an idea but as you say this is for all files are hit its getting tricky. You might try the change below anyway.

For completeness if someone else is reading this thread, newer php versions have phased out dl which is used in the image api. you might need to comment out the following code in include/api/image.php (commented already in this example)
Language: PHP
/* if (($method === NULL || $method == ';imagick';) && !extension_loaded(';imagick';)) { @dl(';imagick.so';); } */


Thomas Seifert
Re: Problems Moving to New Server
April 13, 2013 10:00AM
Quote
Thomas Seifert
if it would be only the image part I'd have an idea but as you say this is for all files are hit its getting tricky. You might try the change below anyway.

I cannot find that line or statement in /include/api/image.php

I've ran a search for imagick.so and @dl with no results. I am running Phorum 5.2.18

The closest item I can find is...

Language: PHP
// ----------------------------------------------------------------- // Try to use the imagick library tools // -----------------------------------------------------------------   if (($method === NULL || $method == ';imagick';) && extension_loaded(';imagick';) && class_exists(';Imagick';)) { $method = NULL;   $imagick = new Imagick(); $imagick->readImageBlob($image); $imagick->thumbnailImage($img[';new_w';], $img[';new_h';], TRUE); $imagick->setFormat("jpg"); $img[';image';] = $imagick->getimageblob(); $img[';new_mime';] = ';image/jpeg';; $img[';method';] = ';imagick';;   return $img; }

For the record, according to Mod:Embed_Images the "gd" is working. (on my old server it said "imagick" instead of "gd" and both return NOT_OK for the Google download test so this isn't related.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 13, 2013 10:45AM
Quote
Thomas Seifert
if it would be only the image part I'd have an idea but as you say this is for all files are hit its getting tricky. You might try the change below anyway.

I just did 2 test attachment uploads.

I uploaded a jpg photo and the image is broken. (embed attachments, embed images).

I uploaded a pdf and the link is displayed properly in the message text (embed attachments) and can be clicked and downloaded.

It's definitely an image rendering issue.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 13, 2013 07:27PM
did you check if the eventlog shows anything?


Thomas Seifert
Re: Problems Moving to New Server
April 13, 2013 08:22PM
Quote
Thomas Seifert
did you check if the eventlog shows anything?

Is that the error_log in the root directory?

There isn't much there besides years of issues with pdfpages (cannot modify header stuff).


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
April 13, 2013 09:00PM
Oh nevermind. You're talking about the Event Logging module. I'll go take a look and see if I can decipher anything.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Problems Moving to New Server
September 01, 2013 09:45PM
Did you ever managed to fix this? I am having the same problem.

BIll

Edited - I managed to fix it .. I explained it in my other post - [www.phorum.org]



Edited 1 time(s). Last edit at 09/02/2013 03:03AM by CBiLL.
Re: Problems Moving to New Server
September 02, 2013 08:39AM
Quote
CBiLL
Did you ever managed to fix this? I am having the same problem.

BIll

Edited - I managed to fix it .. I explained it in my other post - [www.phorum.org]


No. What had happened to me is that HostGator kept shutting us down, so we decided to get a VPS server with Hudson Valley Host and move. It should have been seamless but all images were broken. Thomas suspected it might have had to do with the PHP version the new server was running and suggested some ideas for fixes, none of which worked.

With great sadness, I must admit that we moved on to commercial software. We did a donation drive in the community to raise the funds for the software as well as to hire a developer to migrate the Phorum over to the new software.

We're enjoying some of the new features and GUI eye candy, and I am missing some of the features and ease of use of Phorum. I keep coming back here to the Phorum support forums because I really did get attached to this software and the contributors here.


Robert Angle
Phorum lover, nothing more.
Ruminations
Sorry, only registered users may post in this forum.

Click here to login