views:

2344

answers:

23

I would to be a PHP/Mysql Programmer

what is the technologies that i must know ?

Like :-

  1. Frameworks
  2. IDEs
  3. Template Engines
  4. Ajax and Css Frameworks

please tell me the minimum requirements that i must know , and tell me your favourite things in the previous list ?

thanks

+6  A: 

First of all, that PHP itself IS a templating system

George Jempty
how about (Smarty) ?
Waseem
What about Smarty? Did I say it was *not* a templating system? No. I simply pointed out that PHP is a templating system unto itself. You can downmod me all you want, but I worked at Yahoo! with Rasmus Lerdorf the inventor of PHP, and I am merely echoing his position, and who should know better
George Jempty
PHP is a templating system, but it's absolutely awful at it, and its syntax makes easier to create XSS-vulnerable tagsoup than not to. Compare with PHPTAL which will refuse to generate ill-formed document and won't allow XSS unless you explicitly ask for it.
porneL
Not sure this a *must* know, but I agree with George, can't understand why peeps are modding down!
da5id
George, now you're just being a smart-ass
TravisO
I agree with this...
alex
A: 

You should know how to use effectively at least one Debugger/IDE. It is amazing what you can learn from your code by stepping through it and watching it run. It both makes it much simpler to track down bugs, and improves the quality of your code. I believe you should never commit code to a project that you haven't seen execute.

+1  A: 

Use a great IDE (like Eclipse for example) that let you debug and have some code completion. This will save you some time.

PHP have a lot of programmer and is very popular = a lot of thing is already done for you, before writing some code, doing a google search is always a good idea.

You should use some of the Framework if you start from scratch. This will answer all your question about AJax, template engines... because most of them come with these packages. Here is some post about how to start choosing a framework: SO 1, SO2, Here is a list of PHP Framework.

You can develop PHP on Windows, Linux or Mac.

Daok
+4  A: 

You need to learn the following (I would suggest in this order):

  1. Basic Object-Oriented Principles (such as inheritance, polymorphism, and encapsulation)
  2. The PHP language itself. Specifically, PHP 5.
  3. Database Design Principles such as tables, keys, relationships, normalization, etc.
  4. SQL - Structured (or Standard never can remember which) Query Language. Specifically learn the basics of select, insert, update, and delete queries.
  5. Good design principles and coding practices (you can find posts here on StackOverflow for one) such as dividing presentation and business logic.
  6. A Framework, Any Framework - this will help you become introduced to more advanced concepts of object-oriented design patterns and allow you to follow tutorials that will encourage good design and coding practices.
  7. Object-Oriented Design Patterns like MVC, Database Abstraction Models and the like
  8. Advanced SQL and other database stuff like triggers, stored procedures, and other functions.
Noah Goodrich
+1  A: 

Although this isn't a technology, I think it's very important that you understand that, when using PHP, it is completely on you to write good code. PHP is capable of it, but it does not encourage it. You are completely responsible for writing code that is well designed and, if you choose, follows OO principles. You will have no help from the language.

Lucas Oman
Agreed, and for that reason I'd think twice about PHP as a first programming language - a language with better "training wheels" might be more appropriate.
Sherm Pendley
+3  A: 

I would say the most important thing is to learn how the whole process of building a page with PHP works - in that requests come from a client (web browser), hit the web server, get passed through to PHP, which then generates the response that is sent back. A solid understanding of this will ground you in

  • why you can't send headers after output has started
  • how sessions and cookies work
  • how each page should be built in a stateless manner (i.e. deliver whatever the request asks for, don't remember what happened last time, or guess what the user is doing)
  • The difference between HTML, PHP, JavaScript and CSS, and more importantly, what each is used for primarily and where the responsibility of each lies.

Once you've got that down, then you should be quite comfortable with writing any app. But unless you've got that down, you'll start mixing things as I've seen many rookies do before now.

JamShady
Agreed, but that's more a matter of how the web works - none of that is specific to PHP.
Sherm Pendley
True, but given that PHP is aimed at web development, it's a good place to start. And these issues wouldn't have come up if you only did client side stuff in the past (e.g. html, css, and js). Understanding what PHP specifically is doing is essential to exploiting it.
JamShady
+26  A: 

First off, there is no must know about learning PHP and MySQL... You go into it not knowing anything, and you'll come out of it knowing a bunch. If there was a must know, then nobody would be able to get into PHP and MySQL development. I personally think you are at a slight advantage going into this without knowing everything about it. It'll give you a fresh perspective and a think outside of the box attitude :)

As far as the object oriented stuff in this thread, it's true. But, as others have said, it's completely up to the programmer (you) to decide how to write your code. You can use object oriented practices, make a spaghetti code junction, or just right a bunch of functions, or whatever. Either way, as everyone else has been saying, it's up to you :)

IRC channel:

Don't really need this, but I find it helpful... See you in here :)

irc.freenode.net #php

Manual:

The manual is your friend and probably the only thing you should know before diving in.

http://www.php.net/manual/en/

http://dev.mysql.com/doc/refman/5.0/en/apis-php.html

Frameworks:

Make sure it's an MVC framework :)

http://www.cakephp.org/

http://www.phpmvc.net/

http://www.codeigniter.com/

IDE:

Whatever suits you best :)

http://www.eclipse.org/

http://www.vim.org/

http://www.zend.com/en/products/studio/

http://php.netbeans.org/

Template engines:

PHP is a good template engine

Model view controller frameworks help with this

Ajax:

http://jquery.com/

http://www.mootools.net/

http://developer.yahoo.com/yui/

http://www.prototypejs.org/

http://www.extjs.com/

http://code.google.com/webtoolkit/

CSS:

http://www.yaml.de/en/home.html

http://code.google.com/p/blueprintcss/

http://developer.yahoo.com/yui/reset/

Definitely not an exhaustive list, and things change constantly... But, it's a start :)

Have fun!

Chrelad

Chrelad
What, no JQuery? ;)
ojrac
No Zend Framework? :)
Sebastian Hoitz
No Stack Overflow?
mrinject
phpDesigner is a great IDE, better than many of the ones you listed
TravisO
Nusphere IDE is also a good. Not free, but it does have some good features
AntonioCS
And I would dispute the need for a framework to be 'MVC'.
staticsan
What, no symfony? :)
Peter D
At least don't leave out Agavi! +1 if you add it.
erisco
+8  A: 

Security.

Just like Lucas Oman said - it is up to you in PHP to write the code well; and it does not coddle you. If you don't understand why you need to confirm a logout, or why you can't just validate in javascript, or why register_globals is bad - your app will be vulnerable in some form or another.

Tom Ritter
+3  A: 

That every value everywhere has to be encoded appropriately. echo $some_variable_that_seems_innocent is evil nine times out of ten.

Use htmlspecialchars() in HTML/XML, prepared statements or at least addslashes() when building SQL queries, json_encode() when inserting values into scripts, rawurlencode() when appending URL components, escapeshellargs() when constructing shell commands, etc.

If you insert text in URL that's part of a script in XHTML document, you'll need to encode data three times.

porneL
+14  A: 

What should every PHP programmer know ?

You need to know a language that is not PHP. I'm not saying you shouldn't develop your sites in PHP, it's actually really good for that, but you really need to know at least one other language to get some perspective.

Why? PHP is broken and full of bad design and misfeatures. You can write excellent code in PHP, but you're never going to be able to spot the bad design and failures of PHP itself if you don't know any better.

I'd suggest python, ruby, or C#

PS: If you don't think this is a helpful suggestion, then by all means downmod this answer, but if you are downmodding because you feel insulted by my claim that PHP is broken and badly designed, don't shoot the messenger, I'm just telling the truth!

Orion Edwards
Actually, I like PHP but you have a point. Understanding how PHP works in an object oriented, MVC framework like Zend Framework is loads easier if you have some experience with any of those other languages. Even knowing some Java can help.
gaoshan88
I like PHP too, as a platform. It's on just about every server anywhere, and you just drop some files in a directory and you're good to go. It's awesome. Unfortunately the language design lets it down, but nothing's perfect I guess
Orion Edwards
I think characterising PHP as 'broken and badly designed' is a bit harsh. True, it has problems, but not entirely because of bad decisions 'in the planning stage', so to speak -- most of them are merely historical accretions.
staticsan
PHP was "broken and badly designed" but since version 5.0 it is a wonderful language, altough for enterprise applications.
ArneRie
and PHP 6 is set to carry on the good work that PHP 5 started! Thank goodness we don't have to deal with PHP 4's quirks anymore! :)
Rob
+15  A: 

Security is an important topic every web programmer should study before being allowed to post code that can be accessed publicly on the internet.

Examples of security issues:

There are more security issues that you should know and keep in mind as you write PHP applications. The website http://www.owasp.org contains lots of useful information to help.

Bill Karwin
A: 

Personally, I found the book "Build your own database driven website using PHP and MySQL" extremely helpful.

Other than that, the one thing I found hardest to get used to with PHP is how relaxed it is, compared with any other language I've ever used. By that I mean no types, flexibility about syntax and punctuation. Personally I think that's a good thing, but I also know that it probably encourages pretty bad behavior.

Here's one other tip I have: try to use something like the DRY principle -- i.e., you'll find yourself writing the same little (or big) bits of code over and over again -- make them into functions as early as you can in the process of coding, and life will be a lot easier later on.

Ben
A: 

The PHP Language

Go to PHP.net and read through all of the documentation. When you are done, you won't know everything you need to know about php, but you will know where to look.

Eli
I don't know why anyone would downvote you. This is exactly how I learned.
Max
Ya, I think some people just like downvoting. I tend to discount the people that downvote without a comment.
Eli
+6  A: 

PHP was my first language, which I learned on the side while working as an office junior in my first job over 10 years ago. Here is some things from my experience:

  • Download the PHP manual, print it off, and start reading from page one. Keep going till you're at the end. Skim over the bits you probably won't need (like using KADM5 or Hyperwave) but always read the introductions so you know what PHP is capable of (this will save you trying to re-invent the wheel). The PHP documentation blows the docs of pretty-much every other language I've worked with since out of the water.
  • Next step; set up PHP. Manually. Don't use XAMPP or anything else, do it yourself. It always helps to know how your environment is set up.
  • Don't bother with an IDE at the beginning. Getting to know a language means getting up-close-and-personal. IDEs obscure things in an attempt to help you GetThingsDone which works great when you know what you're doing and know your target environment, but when you're starting out they just get in the way and hide what's important.
  • Don't bother with frameworks at the beginning, either. Again, they're there to help you GetThingsDone which only works when you know what you're doing in the first place. Start with the basics, otherwise you'll be learning the framework and not PHP.
  • PHP is essentially an advanced templating engine. Don't fall into the trap of over-hyped "PHP templating engines". They're just doing what PHP already does, doubling-up on the work and running twice as slow as PHP does. Stick with inline html/php to start with. Again, this'll help you get to understand what PHP is, how it works, and when to use it.
  • As with AJAX and CSS... they're nothing to do with PHP, but with the output you produce from PHP (and with AJAX getting input in). Don't load your plate with too much to eat at once. Start with plain PHP+HTML, and do your CSS by hand. Then, when you're happy, mix in a little javascript.
  • The best thing you can do with any language is learn the environment you're going to be working in, because programming is (relatively) similar across all of them. They all have loops, data structures, input/output, etc, but they all work just that little differently.
  • Don't believe the hype. I'm moving from PHP to Python at the moment and I could've just jumped on the Django band-wagon to GetThingsDone, but I know that if I came across a problem I wouldn't know where to begin to fix it. So I'm taking my own advice and starting from the beginning; reading the manual, setting up an test system, parsing simple files, getting input/output, getting it linked in with a web server... all part of getting to know my new environment.
digitala
+5  A: 

All good answers, but there is something important missing: If you want to seriously get into PHP, then you should be aware that there are a lot of PHP programmers out there who are lazy, inept, ignorant, misguided and unfortunately get their code released to the public. The history of PHP means that it supports some questionable features (not just things like register_globals but also smaller things like automatic initialization) and people still use them. You don't want to.

staticsan
A: 

I would say a basic one would be HTML. ;)

TraumaPony
A: 

Be careful of code snippets you find on the web. Often they contain sql in html, which is bad practice, as well as security vulnerabilities such as sql injection. I've seen few that use prepared statements, which is good for security.

menko
+3  A: 

Ignore the mysql_* functions. Not only do they provide no straightforward method of writing secure code, they actually go out of their way to make it painful and tedious if you try. Use mysqli or PDO instead (and you've got no excuse now - PHP 4 was end-of-life'd months ago).

Ant P.
Or use PEAR's MDB2 for portability across database severs.
strager
+1  A: 

Getting a web server setup

To run PHP and MySQL locally on your computer you will need to install Apache webserver with php module and MySQL database server. ie. a LAMP webserver (Linux Apache MySQL PHP).

In the past, I would recommend installing Ubuntu. These days, there are a few solutions available that will give you one click installation webserver without using linux.

For Windows:
http://www.wampserver.com

For OSX: http://www.mamp.info

After having a LAMP webserver use w3schools.com tutorials to start.

Yada
I've used XAMPP (http://www.apachefriends.org/en/xampp.html) on Windows.
strager
A: 
  1. No Php framework expert.As templating which make the system much complex then as it.
  2. Understand business logic requirement and think the cons/pro.Hoping for SA to think all for you is not good programmer.
  3. No ajax.I dealing with large of data,rendering to one js file about 4000 k data is very bad.
  4. Start from notepad or VI
  5. After learn php about 1 to 2 years,try learn other language like c# or c++ to improve your php application.
  6. Php is addicted language rather then other language.You type it works.Other language,you type It's Compile It's Hang up. 7.For complexity application,php is the best to me rather then other language,because you think,you write it works.
A: 

Beside the points that were already mentioned: You should learn how the HTTP works and that you cannot trust the user.

Gumbo
A: 

Tools.... I've discovered a number of tools that improve code quality, streamline rollouts, and generally make life as a PHP developer a whole lot easier.

Php Programmer
A: 

originally it was a script for perl

knittl