I starting with php

Hi all,
im starting with php
how to run and compile, i be able to run  it microsoft visual studio?
or how is the best advice for star coding and publishing web pages  with php?
regards you experts
Who is Participating?
Ray PaseurConnect With a Mentor Commented:
There is a lot to learn.  Here's a good place to start, with links to best-of-breed learning resources.

Here are (some of) the things to avoid.

PHP depends on the client/server protocols.

The state-of-the-art PHP Editor / IDE is PhpStorm.
However, for just starting out with PHP, you're better off using a plain text editor and writing a few lines of code, just to see what the common errors and pitfalls are.  Then you will know how to spot them, and more importantly, how to avoid them.

You may already know this stuff from your work in other languages, but PHP has a reasonably good object model.

Patterns of test-driven development are popular among PHP professionals.

Some of the most common questions and misunderstandings arise about date/time processing.

Generally speaking, I would avoid Windows and jump right into Linux.  A week or two and you'll know most everything you need to know about the command line.  Without this knowledge, you find that a lot of good information is out of reach.  Personally I use Windows only as a text-editor platform.  I upload all my PHP scripts to a Linux server and run all my tests over the internet, getting the test environment to be a close match with the deployed environment.

Best of luck with your learning adventures!
zephyr_hex (Megan)Connect With a Mentor DeveloperCommented:
Visual Studio doesn't support PHP.  You'll need a different editor.  There are a lot of good ones to choose from (just google it).  I personally use NetBeans.

PHP doesn't compile.  To run / publish it, you just put the PHP file on a server that has PHP installed.

I'm sure many experts will have different ideas on how to start.  My recommendation is that you learn HTML first, and learn the difference between server side and client side processing, as well as the fundamentals of what happens when a user navigates to a PHP file with their web browser (what happens on the server in order to allow the user to see the page?).

You should also understand the basics of web forms, and how to pass variables / data using forms ($_GET and $_POST).

Once you're able to create a basic web form, you'll probably want to delve into learning how to interact with a database from PHP.  MySQL is often used with PHP.

Oh, and I also recommend that you start reading PHP questions here at E-E and attempt to resolve other people's problems.  I've learned so much in working through various problems.
Abhijeet RananawareConnect With a Mentor Web & Mobile DeveloperCommented:
For Windows install wamp or xamp server locally.

For wamp put your project code inside C:\wamp\www\PROJECT_NAME\filename.php

You can run it in browser using http://localhost/PROJECT_NAME/filename.php

For Xamp path will be different


Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Olaf DoschkeConnect With a Mentor Software DeveloperCommented:
Visual Studio is the wrong vendor. There once were IronPython, IronRuby, and IronPHP involving the .NET Framework with these scripting languages, but I don't hear anything about these today.

You may also start more modern in the cloud age and use an online development environment like codeanywhere.

For starters, though, and to also learn a bit about all the tooling including web server, database server and IDE I'd recommend installing XAMPP. XAMPP not only lowers your work about the initial setup, it also includes an Add-On system from Bitnami to easily install Wordpress or other systems.

Once you're having that I'd rather start coding with a simple PHP capable editor like Notepad++. You should aim for PHPStorm as your IDE, but to make better use of the trial period you should learn some PHP first, also to see, whether it is for you at all.

Here's a very strong warning: While PHP is considered an easy beginner programming language, web development itself is involving many things and you may get overwhelmed by also having to learn HTML, CSS and Javascript, SQL and some knowledge in HTTP and web server configuration and other side knowledge to glue this together.

And that's also not the end, basic PHP knowledge will not bring jobs to you, you should also choose yet another thing. What framework in conjunction with PHP will you aim for? Today's two best candidates are Symfony and Laravel. And then it'll also help to know a CMS and Shop System, further things on your to-do list...

Bye, Olaf.
ErnestoAuthor Commented:
oh man, so encouraging messages!
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
As you may figured out from the responses above, PHP is almost entirely different than coding with any of the languages supported by Visual Studio.  One of the most important things in my opinion is that PHP doesn't hide anything from you while language statements like 'runat server' in .NET languages are almost always hiding something from you that shows up differently in the browser.
jet-blackConnect With a Mentor Commented:
I think you should start with a course like The Complete Web Developer Course - Build 14 Websites.
I think "learning by doing" approach is the best way to get experience on programming.

For the IDE choice, it is really hard to tell the best one. You'll need to try out several IDEs and choose your favorite one. I personally use NuSphere PhpED but there are other powerful IDEs like PhpStorm, Zend Studio, etc. (Here is the list of some of them)
If you want to use Visual Studio for PHP development, this is also possible: VS.Php, PHP Tools for Visual Studio
zephyr_hex (Megan)DeveloperCommented:
edo60 - did any of these responses answer your question?  If so, please close your question and mark the answer(s).
ErnestoAuthor Commented:
thank you all
I agree with Ray that Linux is the way to go about it. Install a linux operating system, then install Apache, MySQL, and PHP and you can start there.

The essential PHP and MySQL class on Lynda.com was the first class that really clicked for me. I've been working out of Larry Ullman's PHP and MySQL and that book has been helpful.

Other books I would recommend are Advanced PHP and Object Oriented Programming by Larry Ullman, PHP Objects Patterns and Classes, and Essential PHP Security. I would also highly recommend the book Modern PHP, I'm not there yet but I see the potential after skimming through it - PHP has evolved the past few years into a language that can support large scale enterprise applications and there are a lot of new features in it.

I realize this is a lot but once you get used to the idea that one book won't "teach" you PHP all the way through you kind of accept it and the more you do you have an idea of what you have to do - that's where I am now.

Good luck.
Definitely get PHP Objects Patterns and Practice.

Once you complete Advanced PHP and Object Oriented Programming you will be able to work with frameworks, but Objects Patterns and Practice will allow you to evaluate frameworks and how well they are coded.

PHP and MySQL for Dynamic Websites is the place to start. If you have trouble with it start at PHP for the Web (same author) but that book is a little watered down so I would just start at PHP and MySQL for Dynamic Websites.
Nowadays you can develop and debug PHP projects with Visual Studio using an extension called PHP Tools . There used to be another one called VS PHP but it seems its development is dead. There is a free version of PHP Tools that can work with Visual Studio Community Edition 2013, 2015 and 2017. There is a tutorial for PHP Tools extension here as well part 2 and part 3.

Anyway there are several other IDEs that work on Windows, just are not Visual Studio. Here is a comparison side by side of PHP IDEs actively being developed nowadays, some are commercial but others are free or have free versions.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.