|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm a newbie to PHP and I am having difficulty using fopen with an ftp url. The url is valid and I believe it supports passive mode, but the page never finishes loading ont he fopen call, so I never even get an error message (so I doubt it's a problem with "passive" mode).
A snippet of my code is as follows: $fd= fopen ($ftpurl, "rb") or die("could not open $ftpurl"); fclose ($fd); I've been toying with this for hours and I've exhausted all ideas. I hope somebody can help! |
|
#2
|
||||
|
||||
|
Well I believe that the server by default would try and use active mode, if it needs passive mode then you may have problems. You may be better off using the proper FTP functions http://www.php.net/ftp
|
|
#3
|
|||
|
|||
|
>>Well I believe that the server by default would try and use active mode, if it needs passive mode then you may have problems. You may be better off using the proper FTP functions URL<<
Thanks for the recommendation. I have executed configuration --enable-ftp, but I still get an error when I use ftp_connect (no code executes after the call). |
|
#4
|
||||
|
||||
|
what is the error?
Have you got the FTP library uncommented in the php ini file? Have you restarted the webserver after doing this? |
|
#5
|
|||
|
|||
|
>>what is the error?
Have you got the FTP library uncommented in the php ini file? Have you restarted the webserver after doing this?<< Thanks for the suggestions. Unfortunately I do not have all the permissions that I need to write files in the PHP directory, nor do I have access to the server to restart it. I also do not know how to view my errors -- i do not think my PHP install is set up to display errors. I may end up using some alternative means to ftp, such as exec with wget (if I can get the admins to properly install it . . .) THanks for your advice though! |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > fopen and ftp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|