Solved

I starting with php

Posted on 2016-08-17
12
92 Views
Last Modified: 2016-11-27
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
0
Comment
Question by:edo60
  • 2
  • 2
  • 2
  • +6
12 Comments
 
LVL 42

Assisted Solution

by:zephyr_hex
zephyr_hex earned 50 total points
ID: 41759875
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.
1
 
LVL 13

Assisted Solution

by:Abhijeet Rananaware
Abhijeet Rananaware earned 50 total points
ID: 41759891
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

C:\xampp\htdocs\PROJECT_NAME\filename.php


Regards.
Abhijit
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 50 total points
ID: 41759928
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.
0
 

Author Comment

by:edo60
ID: 41759945
oh man, so encouraging messages!
regards
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 41759954
There is a lot to learn.  Here's a good place to start, with links to best-of-breed learning resources.
https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html

Here are (some of) the things to avoid.
https://www.experts-exchange.com/articles/12293/AntiPHPatterns-and-AntiPHPractices.html

PHP depends on the client/server protocols.
https://www.experts-exchange.com/articles/11271/Understanding-Client-Server-Protocols-and-Web-Applications.html

The state-of-the-art PHP Editor / IDE is PhpStorm.
https://www.jetbrains.com/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.
https://www.experts-exchange.com/articles/18329/SOLID-Design-in-PHP-Applications.html

Patterns of test-driven development are popular among PHP professionals.
https://www.experts-exchange.com/articles/7830/A-Quick-Tour-of-Test-Driven-Development.html

Some of the most common questions and misunderstandings arise about date/time processing.
https://www.experts-exchange.com/articles/20920/Handling-Time-and-Date-in-PHP-and-MySQL-OOP-Version.html

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!
1
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 50 total points
ID: 41760033
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.
1
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 12

Assisted Solution

by:jet-black
jet-black earned 50 total points
ID: 41760152
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
0
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 41796769
edo60 - did any of these responses answer your question?  If so, please close your question and mark the answer(s).
0
 

Author Closing Comment

by:edo60
ID: 41798604
thank you all
0
 

Expert Comment

by:burnedfaceless
ID: 41798643
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.
0
 

Expert Comment

by:burnedfaceless
ID: 41800082
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.
0
 

Expert Comment

by:mlemos
ID: 41903601
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.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now