PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Your first PHP-enabled page> <Getting Started
Last updated: Fri, 14 Nov 2008

view this page in

Here we would like to show the very basics of PHP in a short, simple tutorial. This text only deals with dynamic web page creation with PHP, though PHP is not only capable of creating web pages. See the section titled What can PHP do for more information.

PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages.

What do I need?

In this tutorial we assume that your server has activated support for PHP and that all files ending in .php are handled by PHP. On most servers, this is the default extension for PHP files, but ask your server administrator to be sure. If your server supports PHP, then you do not need to do anything. Just create your .php files, put them in your web directory and the server will automatically parse them for you. There is no need to compile anything nor do you need to install any extra tools. Think of these PHP-enabled files as simple HTML files with a whole new family of magical tags that let you do all sorts of things. Most web hosts offer PHP support, but if your host does not, consider reading the » PHP Links section for resources on finding PHP enabled web hosts.

Let us say you want to save precious bandwidth and develop locally. In this case, you will want to install a web server, such as » Apache, and of course » PHP. You will most likely want to install a database as well, such as » MySQL.

You can either install these individually or choose a simpler way. Our manual has installation instructions for PHP (assuming you already have some web server set up). In case you have problems with installing PHP yourself, we would suggest you ask your questions on our » installation mailing list. If you choose to go on the simpler route, then » locate a pre-configured package for your operating system, which automatically installs all of these with just a few mouse clicks. It is easy to setup a web server with PHP support on any operating system, including MacOSX, Linux and Windows. On Linux, you may find » rpmfind and » PBone helpful for locating RPMs. You may also want to visit » apt-get to find packages for Debian.



Your first PHP-enabled page> <Getting Started
Last updated: Fri, 14 Nov 2008
 
add a note add a note User Contributed Notes
A simple tutorial
tinko at shock dot com dot pk
25-Oct-2008 05:35
Agreed. Some of the pre-configured packs and associated tutorials really can simplify the installation and get you up and running in minutes but you MUST make sure that as an absolute minimum you add a secure password - ideally a mix of letters, numbers, not a real word etc. Otherwise, when your site/system is live, it will be potentially open to abuse.

http://www.shock.com.pk
dnrlvs at gmail dot com
06-Oct-2008 05:42
I'm new to PHP and recently setup my local machine with PHP and MySQL for doing development.  I was sort of stuck when I needed to post my work for the user to test and review.  After looking around a bit I found a site that hosts PHP and MySQL apps.  I was surprised that it was free - it seems they're offering the service at no cost until 2012.  At that point they'll change over to a fee-based service.  However, in the meantime, it's a great place to do anything from demo and sandbox right up to posting sites for real.

Their pitch is as follows:

"This is absolutely free, there is no catch. You get 350 MB of disk space and 100 GB bandwidth. They also have cPanel control panel which is amazing and easy to use website builder. Moreover, there is no any kind of advertising on your pages."

Check it out using this link:

http://www.000webhost.com/83188.html

Thanks and good luck!
chris dot fernald at gmail dot com
05-Oct-2008 03:19
I'm new to PHP and recently setup my local machine with PHP and MySQL for doing development.  I was sort of stuck when I needed to post my work for the user to test and review.  After looking around a bit I found a site that hosts PHP and MySQL apps.  I was surprised that it was free - it seems they're offering the service at no cost until 2012.  At that point they'll change over to a fee-based service.  However, in the meantime, it's a great place to do anything from demo and sandbox right up to posting sites for real.

Their pitch is as follows:

"This is absolutely free, there is no catch. You get 350 MB of disk space and 100 GB bandwidth. They also have cPanel control panel which is amazing and easy to use website builder. Moreover, there is no any kind of advertising on your pages."

Check it out using this link:

http://www.000webhost.com/83188.html

Thanks and good luck!
ctestroote at bresnan dot net
09-Sep-2008 06:21
If youre just learning PHP, then the simpliest thing to use is called Xampp, just install the Apache server and save your php files in the htdocs folder. Then when you open your browser you would type http://127.0.0.1/htdocs/example.php to see your php.

I also use Notepad++ to write my php files but there are many others to use.
Michael
01-Mar-2007 03:54
Agreed. Some of the pre-configured packs and associated tutorials really can simplify the installation and get you up and running in minutes but you MUST make sure that as an absolute minimum you add a secure password - ideally a mix of letters, numbers, not a real word etc. Otherwise, when your site/system is live, it will be potentially open to abuse.
cvncpu
25-Oct-2006 01:53
just keep in mind that these installation packages are for development use, and are not built for a production enviroment, the preformance and security of these tools is not setup for use in a public website.

Your first PHP-enabled page> <Getting Started
Last updated: Fri, 14 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites