PDA

View Full Version : odd problem with ftp upload


jar_uk1
13th of November 2003 (Thu), 17:44
I tried out ee a while back, but thought I would come back and have another look at it after rebuilding my server.

What i see is really nice, but I have an odd problem with the ftp upload, the server is at my home. If i set it up ee with the ftp details as 192.168.xxx.xxx and use the ftp upload it works fine).I got a few photos up and running at www.johnralston.co.uk/gallery if anyone likes scuba diving)

BUT If i set the ftp address as ftp.johnralston.co.uk, it gives me the following error

"CONNECTION ERROR. Please refer ftp messages for more details.
Fatal error: Maximum execution time of 120 seconds exceeded in C:\sokkit\site\gallery\fetchsettings.php on line 1544"

The ftp messages are...

msg 2459 | ftp
JOHNS UPLOAD: FAILED TO DISCONNECT. Reason: ftp_quit() expects parameter 1 to be resource, boolean given
[Thu Nov 13th, 2003 23:23:58]

msg 2458 | ftp
JOHNS UPLOAD: ERROR in connecting to 'ftp.johnralston.co.uk'. Reason: ftp_connect(): php_hostconnect: connect failed
[Thu Nov 13th, 2003 23:23:58]

Step 1 actually works fine, it is 2-6 that falls over! I can connect to the ftp server via a normal ftp program to ftp.johnralston.co.uk, so i know it is correct.

This problem also happens when i connect from outside my LAN. I have increased the timeout from 30 to 120 seconds already. At the moment it is not a problem, but ultimately I would like to upload files remotely.

Could this be a php vs apache 2 problem?? It looks like there are a few of them :-) If so can anyone recommend a combination that might work better, I dont really want to go back to apache 1.3.

It is running on Server2003, the Server info from ee shows the following...
Server signature: Apache/2.0.46 (Win32) PHP/4.3.2 Server at www.johnralston.co.uk Port 80
Server name: www.johnralston.co.uk
Server protocol: HTTP/1.1
Http accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Http accept encoding: gzip, deflate
MySQL version (reported by MySQL server): 3.23.52-nt
PHP version: 4.3.2
Database in use: xxxxx

Pekka
14th of November 2003 (Fri), 05:19
What does ftp test page say? To me it looks like the server refuses to accept ftp connection but does not give any feedback of it, instead it keeps the pipe open and so PHP times out. Reasons for not getting ftp connection may be

- firewall (local or in server)
- IP block (server access restricted to certain IP(s)
- DNS problem (try server IP instead)
- SSL required (global SSL switch coming in next fix pack)
- Ftp server cache is buggy (seen that once so far)

Do you have any special characters like umlauts or apostrophes in login or pass?

Do you have any other ftp servers to try?

john_r
14th of November 2003 (Fri), 07:03
Thanks pekka - I will try your suggestions.

A Normal FTP login works (smartftp) using ftp.johnralston.co.uk, and I can UL/DL files fine through that.

If I am on my LAN, setting the IP 192.168.XXX.XXX allows all the ee functions to work correctly with no timeouts, obviously I canot do that remotely.

Remotely (from work) it times out whether I use the IP address or ftp.johnralston.co.uk.

I am using an ftp server called raidenftp, I will try cerberus instead, see what happens.

No firewall progs running on LAN
no IP restriction
DNS works for www and other ftp program
no odd chars in ftp login or passwords

John

Pekka
14th of November 2003 (Fri), 16:20
Can you view server's ftp log - it should tell something. I'm sure it is ftp server configuration thing - or then a PHP bug....

jar_uk1
15th of November 2003 (Sat), 03:27
I tried using a different ftp server program (cerberus), but the problem still exists. When i set the ftp address as ftp.johnralston.co.uk the ftp log in ee gives me the following message (after a wait)

FTP SERVER NAME: EE PROGRAM SERVER
FTP SERVER: ftp.johnralston.co.uk
CONNECTION (ftp address): FAILED Reason: ftp_connect(): php_hostconnect: connect failed
UPLOAD TEST IMAGE 'ee_test0.jpg': FAILED Reason: ftp_put() expects parameter 1 to be resource, boolean given

Oddly the ftp log on the server shows nothing, not even a failed connection attempt.

Using the IP address instead gives me...
FTP SERVER NAME: EE PROGRAM SERVER
FTP SERVER: 192.168.7.101
CONNECTION (ftp address): OK
LOGIN (username and password): OK
PWD: /
and everything works

I can make an internet explorer connection to ftp.johnralston.co.uk from the same machine that I am trying to connect via ee, so I am pretty sure it is not a naming/permisson type issue.

It looks like a PHP issue? never mind I can live with it for now...

john_r
19th of November 2003 (Wed), 07:42
I seem to have resolved the problem, but...I am not sure how!

I was thinking it might have been a problem with the versions of the php i have installed, so I looked into installing a newer version. being new to php and hosting etc, I downloaded the newest version of the php installer (4.3.4?) and installed it to the c:\sokkit\php path on my server, although after a reboot php was still reporting the same version (4.3.2) I resintalled sokkit (to take it back to the way it was)and rebooted again.

I tried the ftp upload to check the error message wording and lo and it worked!

I can only think it was a php.ini problem??

Oh yes I am john_r and jar_uk1, I forgot my login, then found it :-)