I am asp.net developer , i want to learn php
what are the software need to run compile php file ?
how to install this software any path that should be set ?
what kind of database it needs to store data and retrieve date ?
see me as beginner and then give the idea / information ..........
thanxx
You just need the PHP interpreter and if you want to do web stuff a webserver.
You can get the interpreter from http://www.php.net - if you are using windows you really want to get a binary version and not compile it on your own - and the Apache webserver.
As a database PHP developers usually use MySQL (but it can also connect to most other databases).
The easiest way for your to get started is getting a package like XAMPP which will contain all you need without requiring you to configure everything manually.
For actually learning PHP, please get a recent book/tutorial. Old stuff is usually telling people to do horribly things every sane developer will hate you for (cluttering your global namespace with variables settable by the user for example).
You could have a look at the official PHP docs which also contains a "getting started" guide.
Since you are an ASP.NET developer I assume that you are familiar with IIS and that you're probably using IIS 7.5. If so then the easiest way to familiarize yourself with PHP is to use Microsoft Web Platform Installer and install PHP directly to IIS. You don't have to set any paths after that, just create a site on IIS and start putting PHP files there. Keep in mind that Web Platform Installer automatically enables WinCache extension and your changes might not be there when you hit the refresh button. Just locate the php.ini and comment out the relevant line.
Straight from the horses mouth. Getting Started. You will need a php interpreter, if you have access to a webhost that has php installed you're half way there, if you have a linux partition you're half way there, otherwise check out XAMPP.
Software: XAMPP will get you up and running
Tutorial: w3schools
If you are familiar with IIS and want to use it as your web server you can download PHP for IIS here and use some of the learning material there to get started.
If you did not want to use IIS and wanted to use Apache instead then I agree with the others XAMPP will get you a dev environment up and running quickly.
Related
I recently started PHP (I am a beginner) and I wanted to create a form with HTML to add numbers together. However, when I send queries to PHP it shows my source code (because it is not a server - file is run locally). I was wondering would it be possible to preview my PHP's code result on a website of some sort or even better on my computer? Do you know any services or ways to accomplish this, preferably free of charge?
To run php files online, go to Write Code Online.
As long as you can install programs on your computer, you should install a web server to run php files locally. To run any basic app, especially if it uses forms, you will use multiple php files and the testing will be too complex to run online. If you are using windows, install wamp. For mac, try mamp.
you seriously require some help :-)
First, PHP is a server side scripting language, so it requires server (like Apache, which you can install using the wamp or xampp installers) Try to search google on how to install them on local computer.
Second, their are some online PHP editors, like http://www.compileonline.com/execute_php_online.php or writecodeonline .com and many others. It may not replace the server but helps to write the PHP code and execute it for the sake of practising.
Also, it is better if you read some tutorials about PHP. One tutorial I can point you to is the http://www.w3schools.com/php/php_form_complete.asp which is related to question.
Do I need a special library to run PHP on Windows environment Vista?
I can write simple message like echo "hello" but whenever I try to run any these scripts no error nothing display on the page http://php.net/manual/en/function.crypt.php.
I'm new to PHP please help
When in doubt...
<?php echo phpinfo(); ?>
If that code outputs information regarding your PHP version and settings, PHP is installed correctly.
There would be errors in your code if nothing is displaying. Post the code you are having trouble with and we can help you out.
Have you actually set up a local server? You'll need this to run PHP scripts. For a newbie I'd recommend WampServer since it's really easy and handles all the complexity of installing a server. Once installed and running, try http://localhost/ in your web browser.
Based on your comment though, I think the problem is that the sample code on the page you posted won't work on their own, you'd need to combine them with other things. For example the first one references a variable $user_input which you'd replace with a variable taken from user input (eg a form) on your site.
I suggest finding some tutorials online (or buy a book) and walk through various proper examples to familiarise yourself with PHP.
Do you have PHP / Apache installed at the moment? If you don't, try XAMPP. It comes with an easy and convenient installer.
Like most languages your computer must have the language/compiler installed in order develop and run scripts/applications. PHP was originally designed for web development so you won't usually find it installed on PCs by default.
The easiest way to develop PHP is to upload the scripts to a web server that has PHP installed and then test in your browser in the same fashion that you'd test an HTML page.
Otherwise to do it locally on your computer you can install a web development environment which acts like a web server. Essentially eliminating the upload step.
I believe the most popular for Windows is Wamp Server
I've just started reading about php, it needs me to install php, apache and MySql to run any php script. can any one suggest me a simplest method to install php, apache and MySql so that i can sun those php script.
I've tried the zip files from php.net, Are those required to run the script offline for practicing the script? what do i do with them? i felt the things given on the same site a bit complex, and was unable to run the script. please help.
I'm assuming you're using Windows - get wamp - it has exactly what you need:
Apache
MySQL
PHP
Wamp comes with a nifty tray controller app which you can use to access the most common tasks, like restarting services, editing config, etc.
Equivalent to Artem's post, just a different organization which packages it differently. And my preference. It is called XAMPP.
If you are using Windows, you could install XAMPP to have the environment setup for you. You'll then need to learn how to bring up the server (basically executing the XAMPP control panel program), copy your PHP scripts into the correct directories (for XAMPP, it'd be C:/[xampp installation dir]/htdocs), access MySQL and creating the necessary MySQL databases (you could access the MySQL via the included PhpMyAdmin).
You can probably refer to a tutorial here (it's a YouTube video, BTW).
Don't have enough rep to comment but wanted to add something to Artem's recommendation of Wampserver. It's what I use on my windows machine, and one of the nicest things about it I find is the ability to have multiple versions of versions of apache, php and mysql installed alongside each other as plug-ins and then select which to have running at any time. It makes it easy for me to emulate the eventual hosting environment for any given project.
I want to do a sample program in PHP on Windows XP.
Do I need any special software to get this to work?
I am afraid that I simply open notepad type the PHP program and save it with php extension. Then I open it with the browser as a HTML file. But it does not work.
Please help
Thanks in advance
However you decide to install a webserver and php (or just php and use it in the console like someone mentioned):
Check out the PHP Manual, especially the Getting Started section.
Apache (Very, very easy)
Check out the WampServer getting started presentation.
Download and install WampServer.
And you are ready to go.
Microsoft (Not tested this myself)
Check out PHP on Windows.
Download and install the Microsoft Web Platform Installer.
Let me know how that work out... (never tried it myself, since WampServer is so easy)
You need to have a web server with PHP installed on your PC to make this work.
I highly recommend installing wampserver on your computer. It is a Windows installer that will put PHP, MySQL and Apache in your computer and let you manage all the services and such very easily. If you have problems getting it to work, you can also try out XAMPP, although I've never used it myself.
Some answers containing the hint for using wamp.
You should better use the Zend Server Community Edition.
This is also free and can be downloaded here:
http://www.zend.com/de/community/zend-server-ce
This contains Apache, Mysql, PHP and some Zend related Tools.
Benefit: its much better preconfigured than wamp.
Another easy one to set up (though it takes extra config to support PHP5) is easyPHP
you can simply install PHP, and then run the program and redirect the output
php foo.php > output.html
and then use any browser to open up that html file.
Since you have IIS on the windows cd I would suggest you go to control panel, install/uninstall programs and click on windows components and install IIS. Then install ASP.NET 3.5 from www.asp.net and finally install Phalanger from http://www.php-compiler.net/
That will give you the benefit of both worlds, you can program in ASP.NET using PHP as the language, you can use only PHP if you prefer that or you can mix using ASP.NET/C# on some pages and PHP on other pages within the same application.
I use XAMPP, works out of the box with his installer and is more than enough for a simple developer windows environment.
The simplest way - use www.microsoft.com/web platform installer. get the whole stack to run PHP all from one place.
i would like to share that before starting PHP we have to set environment for that and then we can start working with PHP.
http://code.freefeast.info/php-tutorials/setting-up-the-environment-for-php-php-tutorial/
Are there any "all-in-one" installers for php + mysql on iis? Preferably with a gui configuration interface.
The PHP part is easy with Web Platform Installer:
http://php.iis.net/
MySQL is a breeze to install on Windows:
http://dev.mysql.com/downloads/mysql/5.1.html#win32
I don't know of any all-in-one installers for both MySql and PHP, but PHP itself comes with an automated installer that will attach itself to IIS - but the preferred method is still manual (the automated procedure only uses CGI). There are plenty of how-to pages on the web that give you the step-by-step procedure required to get setup (and these differ based on your version of IIS) - I suggest you use one of those instead.
Some links to get you started:
PHP Documentation
Installing PHP 5 on IIS in 5 simple steps
I know this is not a direct answer, but a point of interest only. If you are looking for something that runs php/mysql that is quick to get setup for testing purposes you could try using a virtual appliance+vmware server/player
I don't know of any all in one installers, but you are probably better off just installing MySQL and PHP seperately. It's pretty straight forward.
MySQL has a GUI installation wizard in windows. I'm assume you know where to download this. You can download PHP for IIS from the Microsoft website here. It will have a GUI interface to some extent for installation:
http://www.microsoft.com/web/gallery/install.aspx?appid=PHP53
You will probably need to still reference MySQL by editing the php.ini file manually. This is a particually good FAQ:
http://learn.iis.net/page.aspx/353/install-and-configure-mysql-for-php-applications-on-iis-7-and-above/