Using a PHP-Enabled Web Hosting Site

There are a large number of companies that offer low-cost or free web hosting packages with PHP and MySQL support. To start looking for one, perform a web search for php mysql web hosting. These hosting packages usually include FTP access to copy files to your web directory, and a web-based MySQL client such as phpMyAdmin.

To get your site up and running on such a site, first copy your files across to the server using FTP. Under Linux, the KDE Konqueror and GNOME Nautilus file managers both support FTP. Under Mac OS X, select “Connect to Server” from the Finder Go menu; you can also use the free Cyberduck program. Under Windows, you’ll need to download an FTP tool such as FileZilla (http://sourceforge.net/projects/filezilla).

To connect to the server, enter your username and the name of your FTP server—for example, ftp://adam@isp_ftp_server.net. If you’re a power user and want command-line control, including possibly scripting file transfers, you can use the ncftp tool set (http://www.ncftp.com/ncftp), especially the ncftpput program. This is the tool we use ourselves, and is available for Linux, Windows, and Mac OS X.

Now, how do you set up the database? Well, there are two ways. You could create the database on the web host; this is likely to be tedious. A better solution is to create the database on your own machine and then export it to the web host.

You can export data from a database into an SQL dump file using the mysqldump command discussed ...

Get Learning MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.