/    Sign up×
Community /Pin to ProfileBookmark

–enable-ftp ???

I’m adding a feature to a very simple web forum, to allow users to attach a file to their post. I have set up an additional ftp login with my host server, I’ve set the chmod to 777 on the directory that it points to, and now I’ve got some code. I get the error “call to undifined function: ftp_connect()”…

I see in the [URL=http://us3.php.net/manual/en/ref.ftp.php]php manual[/URL] that it says to “add the –enable-ftp option when installing PHP 4 or greater”.

Does the error mean this is something I need to do?

If so, how? Add a line to my .htaccess file? If so, how?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@strBeanauthorFeb 22.2006 — This is what it says:

In order to use FTP functions with your PHP configuration, you should add the --enable-ftp option when installing PHP 4 or greater or --with-ftp when using PHP 3.

I'm using my own copy of PHP 5. It could be that I need to add a line to my php.ini file. I called my hosting service, not much help.

Anybody ever had ftp_connect() generate an "undefined" error?
Copy linkTweet thisAlerts:
@SheldonFeb 22.2006 — why ftp? Why not upload the file?[url=http://php.net/move_uploaded_file]move_uploaded_file[/url]
Copy linkTweet thisAlerts:
@strBeanauthorFeb 22.2006 — Sorry, *****ious newbie here.

I don't need ftp to offer users the chance to upload a file? What do I call to upload the file, before I move it with move_uploaded_file()?
Copy linkTweet thisAlerts:
@strBeanauthorFeb 22.2006 — ps. Censored?? What is so nasty about "a m b i t"?
Copy linkTweet thisAlerts:
@SheldonFeb 22.2006 — with a form, use a <input type="file"> then your form processing will involve the move_uploaded_file();
Copy linkTweet thisAlerts:
@strBeanauthorFeb 22.2006 — Geez. Seems easy. 2 arguments.

For [i]filename[/i] and [i]destination[/i], do I use the full path for both of them?
×

Success!

Help @strBean spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...