openSUSE Forums > Network/Internet » How do I configure PHP to use vsftpd server

Go Back   openSUSE Forums > Network/Internet
Forums FAQ Members List Search Today's Posts Mark Forums Read


Network/Internet Questions about internet applications, network configuration, usage (SAMBA, network printing, NFS)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-May-2009, 08:27
Puzzled Penguin
 
Join Date: May 2009
Posts: 2
bctony hasn't been rated much yet
Default How do I configure PHP to use vsftpd server

I am a newbie with limited knowledge. This issue refers to SUSE 11

I need to be able to allow ftp uploads from within a web browser which I know can be done with a PHP script. I have got to the stage where I have successfully installed Apache and vsptd and configured them so that I can see the linux box from a remote computer (both HTTP and ftp).

I have seen my exact question asked but not answered in this forum.

From my research, I understand that PHP needs to have ftp enabled. The nearest instructions I have found say that I have to run the following in the PHP source directory:

./configure -enable -ftp

I don't know which directory is the PHP source directory, and I have tried doing a system wide search for "configure" without success.

And I have read chapters 21 and 22 in the SUSE reference manual - they didn't help.

Is it possible to give me sufficently simple instructions on what to do?

Many thanks in advance for any help.

Tony
Reply With Quote
  #2 (permalink)  
Old 11-May-2009, 08:54
Explorer Penguin
 
Join Date: Apr 2009
Posts: 684
ab@novell.com hasn't been rated much yet
Default Re: How do I configure PHP to use vsftpd server

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think you're confusing a few protocols. First, PHP via Apache is not
going to use FTP normally, and PHP doesn't run via vsftpd (or any other
FTP server) because PHP is interpreted. Using a web browser to upload
files is possible but I don't think it actually uses FTP in any way but
instead just uses HTTP to send the files. This would use PHP, but still
may not be the best option for you.

So, what are your needs? Do you need to upload via a web browser and if
so, why? If it is because you are uploading from a certain place on your
website with a form and a submit button then that makes sense and PHP
could help with that, but if you want the web browser to "talk" FTP then
usually you point it to ftp://your.site.goes.here/incoming/directory/here
and then let it handle the FTP communications entirely and leave PHP out
of the mix. If this is something you will be doing full time a full FTP
client will make you much happier since they often support continuing a
transfer after it fails, progress bars that are nicer, simpler
authentication, recursive uploads/downloads, etc. With all this said it
comes down to what your needs are.

Good luck.





bctony wrote:
> I am a newbie with limited knowledge. This issue refers to SUSE 11
>
> I need to be able to allow ftp uploads from within a web browser which
> I know can be done with a PHP script. I have got to the stage where I
> have successfully installed Apache and vsptd and configured them so that
> I can see the linux box from a remote computer (both HTTP and ftp).
>
> I have seen my exact question asked but not answered in this forum.
>
> From my research, I understand that PHP needs to have ftp enabled. The
> nearest instructions I have found say that I have to run the following
> in the PHP source directory:
>
> ./configure -enable -ftp
>
> I don't know which directory is the PHP source directory, and I have
> tried doing a system wide search for "configure" without success.
>
> And I have read chapters 21 and 22 in the SUSE reference manual - they
> didn't help.
>
> Is it possible to give me sufficently simple instructions on what to
> do?
>
> Many thanks in advance for any help.
>
> Tony
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKCC4MAAoJEF+XTK08PnB5VCIP/0KA0NX/o6PqvvdhsTLDMg6V
HehDKcCdzjX3a+wxDMhe05fF+dcxTPj8ka3KP+FyfWWRiLAVp6 n6BV/7i4u4y9Ty
QTDtHRtcw4yHnKKjGYGa33y6Bdy+KNqlIPmFKdK6XZ+kyJoPl4 GtM8YQTbwUHgb5
2DSM1xFpNqdq4ckHMdf5tj81OpYozxGXPKdgjehQDahRZ9YUQK S1Fn99gyTfRl8P
NcROIjDRPZP+REhkl1oX1LL0r6aqvZRSHbXArh9o/7fGdTFxOlDSFfiNezaDf/h5
xgYuqqTH8DYhMVM0MGf1HkU60b37YGO84N3apoBQnOJBF1LrZk vDmQ6Mdrcy545o
Pq420SZZxqi2BVXtVb3U1cr2Y+Je5s/p+OV77YTHl/V0HEIFy7xsAiYoOw5fVR6Y
ZGruPDctS/MaH8s5uLA4Bg4o8hhymLkYef4JrarAHtFKQgThu+WWX1Hbqf+P EMTG
6mmeYu4D9VqtcR8DjSUxVIPj56dZ8sqWtOnXGLyP29AImel2Of Hq+Gy0pP3mOfvf
OAIAOXWeuXhKSVG2KZe9FyQ9GCIM9kD6KksStGtEudH1JV2bml c9aSdVKdr9FgxA
lm4qjMIIAsOByS/PRNw6L9h2Melomw9eHg+xjrH6u8ysQ8+HDiX56HKBTCEXe7Q4
pXosfdnd2Ng5/9lhYejd
=BC9h
-----END PGP SIGNATURE-----
Reply With Quote
  #3 (permalink)  
Old 11-May-2009, 22:49
Puzzled Penguin
 
Join Date: May 2009
Posts: 2
bctony hasn't been rated much yet
Default Re: How do I configure PHP to use vsftpd server

ab - many thanks your prompt response.

I need to embed an ftp client within a web page to make uploads as easy as possible for the least computer literate; i.e. those who would experience difficulty using a standalone client like FileZilla.

One way to do this is to embed a third party product called "ftp navigator" available from the Adobe Dreamweaver add-ons collection. This product is written in PHP and for it to work the PHP server on the host has to be able to connect to the ftp server on the host: hence the "./ configure -enable -ftp" command to the PHP builder.

In the case of the Apache version in SUSE which has PHP5 enabled by default, the PHP5 server doesn't have the ftp access option compiled in by default. I want to know how to turn it on.

I hope this is a bit clearer, and I apologise if my first question was garbled,

Tony
Reply With Quote
  #4 (permalink)  
Old 11-May-2009, 23:09
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,228
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: How do I configure PHP to use vsftpd server

Fine re your explanation on the client side, but on the server side, the two services are distinct. The Apache server (which is what serves PHP pages) doesn't do FTP. So you would need to set up vsftpd separately. There are various tutorials on this. I would recommend using FTP over SSL to protect passwords and using a separate password database so that you don't have to create logins and hand out login passwords, which could be dangerous.

The php5-ftp module is more likely to allow PHP pages to act as a FTP client, and isn't relevant to your task.
Reply With Quote
  #5 (permalink)  
Old 11-May-2009, 23:21
geoffro's Avatar
Wise Penguin
 
Join Date: Mar 2008
Location: Västerås, Sweden ex. Highbury London UK
Posts: 1,288
geoffro hasn't been rated much yet
Send a message via MSN to geoffro
Default Re: How do I configure PHP to use vsftpd server

As ken wrote you can use the php-ftp module there's quite a lot of info on the web.
Did a google for "php ftp" and got a lot of hits there is a tutorial here PHP's FTP functions tutorial

And the manual is here PHP: FTP - Manual

Geoff
__________________
Core 2 Duo 3.16GHz, 8GB DDR2, 3.5TB, GeForce 9600 GT, Amilo LCD 26", OS 11.1 x86_64, KDE4.2.4 (2)
My wine tips & tricks
Reply With Quote
Reply

Bookmarks

Tags
ftp, php, upload


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2