LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Best way to start learning PHP, and therefore Apache and MySQL (https://www.linuxquestions.org/questions/linux-newbie-8/best-way-to-start-learning-php-and-therefore-apache-and-mysql-4175481761/)

anon091 10-22-2013 02:48 PM

Best way to start learning PHP, and therefore Apache and MySQL
 
Hello everyone. Just looking for some guidance here. I'm going to have to inherit some websites that are written in PHP that access some MySQL databases. I can't say I know much or where to start with learning PHP, the Apache that hosts the site, or MySQL that contains the data.

Simply Google'ing learn PHP, Apache, MySQL presents an overwhelming number of options. Any tips on where to start? Any good links for a beginner you would recommend that I should start with?

Programming isn't totally foreign to me, but never done anything with PHP exactly, and definitely have no idea where to start with Apache and MySQL.

Thanks in advance for any words of wisdom.

sag47 10-22-2013 03:32 PM

XAMPP is a good start as a local app server with apache+mysql with php built-in for playing around.

PHP at w3schools is a good start.

anon091 10-22-2013 04:02 PM

Great, thanks sag, i'll check them out.

sparvin 10-22-2013 04:09 PM

Quote:

Originally Posted by sag47 (Post 5050522)
XAMPP is a good start as a local app server with apache+mysql with php built-in for playing around.

PHP at w3schools is a good start.

On the first point, I completely agree. On the second, I contest.

The way I learned was by reading small snippets of code and trying them out in the XAMPP environment to see what it did (this is also how I learned HTML). When I had a question about what a PHP function would do, I looked it up in the docs at php.net. It's excellent documentation with a good search function on the site. I've discovered that w3schools is just about useless when trying to learn anything useful.

BTW, I didn't learn SQL in a conventional way. I worked at a job where I had to occasionally sort and re-format price-lists by hand. For the smaller lists (less that 65,535 lines) I used Excell '97, but for the bigger lists, I imported the list into a table in a new Access database, and used the GUI to sort and re-format the table. That's what got m e familiar with the SELECT, FROM and WHERE clauses. Learning how to connect PHP with MySQL was easy once I was used to the PHP docs.

sag47 10-22-2013 07:07 PM

Quote:

Originally Posted by sparvin (Post 5050550)
The way I learned was by reading small snippets of code and trying them out in the XAMPP environment to see what it did (this is also how I learned HTML). When I had a question about what a PHP function would do, I looked it up in the docs at php.net. It's excellent documentation with a good search function on the site. I've discovered that w3schools is just about useless when trying to learn anything useful.

I agree with this assessment. I don't think I've ever actually learned a language by using a tutorial myself. It has always been hacking on pre-existing code or checking out and learning the source of projects at sourceforge or github.

chrism01 10-23-2013 05:21 AM

Indeed the php.net docs is full of example code; actually, the MySQL home site docs are pretty good in this respect also.
http://www.php.net/manual/en/
http://dev.mysql.com/doc/refman/5.1/en/

anon091 10-23-2013 08:22 AM

I'm in the same boat as you guys, usually my venture into a language starts with having to hack at something someone already built to slightly tweak it, which surprise surprise is the situation i'm in again, but I feel a little overwhelmed knowing there's also apache and MySQL that PHP has to play with.

The PHP code kinda makes sense looking at it myself, but figured I should start getting myself some sort of php background to understand the nuances of what i'm looking at (and probably making way too many assumptions with).

Thanks to everyone!

szboardstretcher 10-23-2013 12:24 PM

Most people will just say 'read the docs' or 'just jump right in,' and im sure that works for some people. But for me, a quick hands-on walk-through of the basics is always best.

Here you are: http://www.codecademy.com/tracks/php

Doug G 10-23-2013 01:19 PM

If you are interested in learning what's needed on the server to make LAMP work I recommend taking an old machine and building an ispconfig3 server. There are tutorials for different distros at http://www.ispconfig.org/page/en/ispconfig.html

Take the time to figure out why various packages are being installed and what they do for your server and you'll have a good understanding of how a secure php web server operates. Their tutorials cover step-by-step installation and configuration starting with a blank new machine.

And you'll end up with an excellent environment to develop your php (and other) code. Just stick the server you built on your local network and use it as your development server rather than installing php/apache/mysql on your workstation.

ispconfig3 is an open source control panel, built using apache, php and mysql.

officerx 10-23-2013 04:09 PM

You just received great advice from this guys wish I had the same advice when starting out coding in PHP. Rather than burning through pages and pages of different books which take up 5 pages explaining something you could spotted whilst just coding.

anon091 10-28-2013 10:45 AM

Thanks to all who chimed in on this!


All times are GMT -5. The time now is 07:43 PM.