PHP tutorials...getting started...LAMP installed...what next?

Status
Not open for further replies.

GohanIYIan

Ars Legatus Legionis
10,196
In a redhat environment, /var/www/html is probably owned by user/group apache.

If you stick with PHP, I'd recommend starting with a framework like Symfony and using the framework's tutorials. It'll protect you from a bunch of basic mistakes and introduce good, language-independent concepts. There's tons of bad PHP advice online, so just taking solutions from google isn't always a great idea.
 

inpher

Well-known member
3,697
GohanIYIan gives good advice. Symfony is a nice framework, Yii is pretty good as well (but IMO it lacks good documentation). Then there's alway my goto recommendation: Drupal which lives in a fuzzy space between CMS and framework in that it gives you the basic UI for free. And even if you go home-brew all the way, please stay away from the mysql_* functions (PDO is your friend to learn).
 

chocoruacal

Ars Tribunus Militum
2,173
Start with a framework. I like Laravel and Yii (in that order), but Yii definitely is easier to get up and running. You'll find plenty of tutorials for each. I also find it instructive to look at the various user created packages and add-ons that exist for both. A framework will give you a taste of raw PHP and nudge you into best practices.

Ignore the PHP haters. You probably don't want their advice about anything programming related, regardless of the language.
 

GohanIYIan

Ars Legatus Legionis
10,196
[url=http:/civis/viewtopic.php?p=25269823#p25269823:1v6ioncv said:
chocoruacal[/url]":1v6ioncv]
Ignore the PHP haters. You probably don't want their advice about anything programming related, regardless of the language.

I don't think this is very good advice. You're much better off understanding the language's flaws & gotchas and in turn how to work around them than pretending the flaws don't exist.
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
[url=http:/civis/viewtopic.php?p=25269823#p25269823:26586xvu said:
chocoruacal[/url]":26586xvu]Ignore the PHP haters. You probably don't want their advice about anything programming related, regardless of the language.
I've hacked around PHP core when I was still under the illusion that there was something worthwhile there, I've forgotten more about PHP than most folks who defend it ardently have ever learned, and I'll still say nobody should learn to write code via PHP. PHP is a pedagogically shit language and isn't much better when you aren't learning. Its ardent defenders are almost to a man people who don't really understand other, better tools and who reflexively defend it because it's all they've got and it shows with the "but you can get stuff done!" excuses and other flimsy rationales behind the tooling, the environment, and the reality-averse culture. If you can read A Fractal of Bad Design and still say with a straight face that, yeah, people should just toddle on and learn it, you don't belong talking to novices about anything pedagogical, seriously.

When you have to call people who disagree with your rickety, slow, badly designed ecosystem "haters", you are in a really stupid place.
 

broody

Seniorius Lurkius
25
It's sad that there's no truly beginner-friendly alternative to a bare AMP stack to get started with web development. PHP is alluring because you can just progressively enhance some HTML files, upload them and that's it, you have a dynamic website. Even something like Flask is much more complicated to setup, and as you're dealing with a framework much of what goes on will just seem like magic.
 

Alamout

Ars Legatus Legionis
27,285
[url=http:/civis/viewtopic.php?p=25274373#p25274373:3e8jsgf0 said:
broody[/url]":3e8jsgf0]It's sad that there's no truly beginner-friendly alternative to a bare AMP stack to get started with web development. PHP is alluring because you can just progressively enhance some HTML files, upload them and that's it, you have a dynamic website. Even something like Flask is much more complicated to setup, and as you're dealing with a framework much of what goes on will just seem like magic.
Well, I think it's because there's not much that's beginner-friendly about trying to set up a combination of services like that. It's just a significant amount of IT-ish grunt-work that you have to learn, and if you haven't done any of it before then it'll be tough.

If you just want to learn some web development, you can use lightweight servers and databases, like Django's built-in server and sqlite. At that point you only need to learn Python (and Django). But you aren't building something you can expose to the internet.

I agree that there's an unfortunate barrier to entry there (certainly it's kept me from knowing as much as I'd like about this stuff). Not sure what the best solution would be though.
 
[url=http:/civis/viewtopic.php?p=25274373#p25274373:29b6daz3 said:
broody[/url]":29b6daz3]It's sad that there's no truly beginner-friendly alternative to a bare AMP stack to get started with web development. PHP is alluring because you can just progressively enhance some HTML files, upload them and that's it, you have a dynamic website. Even something like Flask is much more complicated to setup, and as you're dealing with a framework much of what goes on will just seem like magic.

I'm quite partial to Flask for that situation. I think it has about the right level of magic and the documentation is excellent at explaining both what the framework is doing and why.

I think the main problem is that "simple" is mostly synonymous with "wrong". A CGI(ish) approach where a standalone script just runs procedurally and prints a webpage is simple to understand, but it's a mess to grow or maintain and you can't refactor it into a proper architecture very easily. It's better to bite the bullet and learn something that steers toward a decent design pattern.
 
Status
Not open for further replies.