Jump to content
xisto Community
Sign in to follow this  
mrdee

Best Online Or Local? Which way is recommended to practice PHP/MySQL?

Recommended Posts

I am in the process of trying to learn PHP/MySQL programming.The resources I use at the moment are some books (PHP & MySQL for Dummies and some other general books and E-books about PHP/MySQL) and online tutorials.It is not easy to find a college or educational institution that gives something like evening courses on the subject, so, at the moment, I am a bit tied to self study.What I would like to know, however, is what people recommend for practice purposes.I do have my webspace with Xisto, which includes PHP and MySQL, but, obviously when I do some exercises, that means I have to dump thos files on my web space, and sometimes, you forget to delete them, leaving you with (unnessecary) clutter on the server. (At least, that is what I think).That is why I would like to ask the more experienced people what they would recommend: Would they agree that what I just described is true, and clutters up your web space, or is it not really an issue to practice and do exercises like that?Or, would they recommend to install a server (eg. Apache) and PHP and MySQL on my PC and practice locally?If that is what people would recommend, is there any preference as to which server and PHP and MySQL to install?Or will just any source do?I am just thinking about things like ease of install and ease of use.Looking forward to your answers.Thank you in advance.

Share this post


Link to post
Share on other sites

Definitely local. You don't have to use FTP, just your file manager and a source editor.If you're using Windows, install WAMP or XAMPP (Windows, Linux and Mac). Both create a directory that contains a folder called "www". Dump your files and folders in there and you can access them through "LOCALHOST/" in your web browser. You can choose whichever server you like from the web, it doesn't matter for a beginner that's just going to use PHP and MySQL. Just make sure the package contains Apache, PHP, MySQL and phpmyadmin.EDIT: W3Schools PHP tutorial series is good for beginners. It doesn't teach you "handy things" that you can use later tho. If you combine what you've learned, there are lots of tutorials on the web that show you how you accomplish things like a login system, commenting and other stuff. The best way to learn for me was to use the code I had learned and have goals and things I wanted to make with the code. It makes you search for stuff on the internet and you slowly gather more and more information.

Edited by Baniboy (see edit history)

Share this post


Link to post
Share on other sites

Yes, Baniboy,the one that I am certainly not going to forget to put on my list is W3Schools, I follow the PHP/MySQL tutorial chapter by chapter there.I just installed WAMP on my PC (Yes, I use Windows, Windows 7 Ultimate, by the way) an I will now have a look what it is doing.Anyway, looks like you have been giving me some great advice (again), I shall be checking it out now.Thank you once again.

Share this post


Link to post
Share on other sites

Yes, Baniboy,the one that I am certainly not going to forget to put on my list is W3Schools, I follow the PHP/MySQL tutorial chapter by chapter there.

I just installed WAMP on my PC (Yes, I use Windows, Windows 7 Ultimate, by the way) an I will now have a look what it is doing.

Anyway, looks like you have been giving me some great advice (again), I shall be checking it out now.

Thank you once again.


Excellent Excellent, Wamp is a great piece of software, in terms of coding on windows I've been using Aptana Studio 3 and I really like it, and might I recommend if like me you are into video screencasts the excellent "diving in to php series" by Jeffrey way of Nettuts, it helped me a lot, and it is really fantastic. Net.tutsplus.com is a fantastic site anyway and I really enjoy their CodeIgniter from scratch series which goes through the PHP framework I use (yes I use a framework, I'm lazy).

I'll link you to the Diving in to PHP series, it is for absolute beginners to PHP so it's a good resource: LINK

Go through their PHP tutorials, especially their screencasts. They are truly excellent!

Share this post


Link to post
Share on other sites

yes Wamp and Xamp both are good but if you are a newbie then i recommend you to get EasyPHP, it comes with several modules which contains many popular opens source CMS (like wordpress, joomls , ...) and many free forum softwares (mybb, smf,...) and these modules are in form of an installable exe file which you install in the same directory as you have installed you easyphp then by running easyPHP and going to its administration page you can see those softwares you have installed being available, so by this way you bypass the installation process of each software, it will create mysql database and admin account itself and will give you required information for accessing to your installed software. working with it is same as others like xamp and wamp and for seeing your own created page you need to put it in www folder in installation directory, i really recommend this when you want to test a CMS or Forum to see if it fits your needs.I don't know if you are interested in reading paper books because these days every one finds learning through net is so much easier than buying paper book but still i think one of those great books i have ever read in php learning is "PHP Objects, Patterns, and Practice" by "Matt Zandstra" , it seems there is 3rd edition available in Amazon but mine is the second edition, i'm not interested in paper books too but this one is really different i recommend it to everyone who wants to learn php. another source i recommend for php is the chm file they have putted in their website (php.net), it will be a real help when you are writing your page, but it is a little old fashioned anyway. for learning html and cms you don't need any book because w3shcools is enough for anything you want maybe if you want a particular thing to be done by cms it is better to just search it in google and you will find the answer. i haven't find any interesting resource for java script all of them are nearly same so i suggest you to first search a rich website (Dynamicdrive.com) for finding your interested script in it and only change it a bit, this is much easier than trying to write one using ebooks available on the net.I don't think leaving files on the server is the main problem, i think the main problem is time, when you work it online then every time you reload the page or upload anything you have to wait more than when you do it on your local host.

Share this post


Link to post
Share on other sites

Thanks again, folks.i do appreciate your help a lot.By the way, the same names keep coming back with replies in whatever toic I post, it seems. :)Do you people know everything or something? ;) Anyway, back on topic:I had a look at all the things that were recommended to me (WAMP, XXAMP) and tried them out, but they indeed seemed to present considerable difficulty for a beginner when it comes to setting the correct configurations.Then i saw the last recommendation (EasyPHP) and that brought back some memories, as I used it for a while a long time ago, but at that time it was quite buggy.However, when I saw your description about all the things it has on offer now I went to have a look, and i was indeed amazed, so I installed it right away.I must say, it has improved enormously.Now offering Wordpress, Joomla, a number of forums and even an online shop has made it a great piece of freeware, but what is even better is that all those modules can be installed and ran at test level (ie. your own hard drive) so you do not have to worry about taking up valuable server space on your hosting space or being frightened about messing something up while testing.I also found an electronic version of a book that was recommended, so, nothing is to stop me now of going on my way to learn how to make interactive websites.Thank you ever so much, everyone, but be warned, do expect more of my idiotic, ignorant questions soon when I get stuck somewhere.Thank you again.

Share this post


Link to post
Share on other sites

WAMP or XAMPP are the best, but as a beginner i will recommend XAMPP. it is easy to install and use. in fact the new version doesn't need and configuration, not like the older ones. all you need to do is save it from here https://www.apachefriends.org/download.html

 

unzip it and install it. when it finished you will get a folder named XAMPP in your c drive. inside it you can see a folder named "htdocs" and this is where you should save your php files. once you save them there, you can view them in your browser by only typing LOCALHOST/yourfilename.php

 

but don't forget to start apache and mysql from the xampp control panal each time you start working with your php files. that's all.and for best php codes try using an editor that supports php language. i recommend you adobe dreamweaver cs, you can download the trial version from the official site. or you can get this one, komodo for free from here http://www.activestate.com/komodo-ide/downloads/edit

 

and use it to write your codes. after all, training on php codes locally is better 10 times than on any other way. because simply, it will be faster and easier to practice. especially if you are a beginner. good luck.

Share this post


Link to post
Share on other sites

OK, great stuff, everyone.First of all, I am very grateful for all the useful and expert advice I am getting here.Now, one further point (about any of those programs, really: WAMP, XXAMP or EasyPHP):I know it was possible with WAMP, but that is where the dreaded configuration came in again, and, to be quite honest, the support for that program is not always very clear, but, my question is, really:is it possible to run the same set of files (I mean, the same localhost, the same "www" or "htdocs" folder) over a network, or do you have to install the program(s) on every machine on the network?The reason why I am asking is: I usually install programs on my PC, but sometimes it would be handy to be able to do some of my practice, when I am somewhere else in the house, on my laptop.In that case I think it would be good if I can just (and that seemed to work in WAMP, but not other things) see the Intranet website on LOCALHOST/whatever/ on my laptop, and also get to the files, open PHPMyAdmin, get into MySQL etc. (that was the real headache while using WAMP, as I said, I could see the website on localhost, but was unable to reach the files (I could after I shared the folder, but that was about it), I could not get into PHPMyAdmin, I could not send any queries or look at any of the databases through MySQL, which is really what I would want to achieve, but hopefully, I would not have to install the program on both machines and just run them from the PC, functioning as server, through to my laptop.I know I am a bit fussy, but, that's me for you. :blush: Thank you everyone.

Share this post


Link to post
Share on other sites

hmm i think the process in all the apps should be same a s all of them are apache based servers, so you should do something like this :first find "httpd.conf" file, in easyPHP it should be located in /EasyPHP/apache/conf but in other ones you just search it and you will find some, then only edit that one which is in apache related folder. then make sure the listen line exists in it for example in EasyPHP you will see something like this "Listen 127.0.0.1:8888" (in the file those lines that start with "#" symbol are not active lines and are just comments), if it doesn't exist then just make it, if it exist then you should be able to access your local host using the ip of your host and the port but it is very important to check and see if the port (for example 8888) is not blocked by firewalls in any computers in the local network, you can do this to any software which creates apache server and is not only for WAMP or any specific software .accessing the phpmyadmin needs another configuration too, for doing this you will need to again open the httpd.conf file and search for a line including the directory of phpmyadmin (it starts with "<Direcotory ... ") then add a line in it like "Allow from 192.168.xxx.xxx" which is ip of your laptop and then save the file, then search and find the file "config.inc.php" which is related to phpmyadmin configuration and open it and add the line "$cfg['PmaAbsoluteUri'] = "$_SERVER[HTTP_HOST]:$_SERVER[sERVER_PORT]/mysql/"; " in it and save, so now you should be able to access your phpmyadmin too (again this process should be somehow same in all of local host makers).If you are using EasyPHP then in the httpd.conf file there are some other directories too so just add the allow ip line in each of them to prevent from any faults. if you had problem with accessing the local host on server using the ip and port of server try to use name of the machine and if you want to be able to access from all of your PC in the network just add their ips in the allow line or just put a "Allow from all" in each directory but this is not recommended if you are connected to internet.All of these things are available in the FQA of EasyPHP with more details and if any of above codes are not working search there for more helpful instructions : http://www.easyphp.org/

Edited by OpaQue (see edit history)

Share this post


Link to post
Share on other sites

to answer your question, yes you should have apache, mysql and php installed on every pc or laptop you want to run your php scripts on locally. and about the configuration thing, try XAMPP instead of WAMP, it easier to deal with. therefor, it is always recommended to use XAMPP if you are a beginner, so try it if you want and ask me if you have any question. good luck.edit:when you complete installing, try to type only "localhost" and then you should see the XAMPP page. and from there you should to enter phpmyadmin. if you failed to see any of them then there is something wrong in your installation.and as i told you Xampp doesn't need configuration.

Edited by OpaQue (see edit history)

Share this post


Link to post
Share on other sites

a) To correct and prevent you from doing pointless work, web_designer's response has nothing to do with what you asked for, so don't waste your time doing that. Instead try what Iniyila mentioned. I haven't ever had to do this so I don't know. What I do know is that you should leave the server computer on while you're accessing localhost. :lol:

B ) There is nothing complicated about WAMP or XAMPP. XAMPP is heavier. And you won't ever learn anything by having everything pre-installed for you and by not having to configure anything.

and about the configuration thing, try XAMPP instead of WAMP, it easier to deal with. therefor, it is always recommended to use XAMPP if you are a beginner

And there is nothing to configure about WAMP when installing except when it asks for the mail server, which you leave at default because you don't need it now. Then you just start WAMP and use the server. And also, there is no reason why a beginner should favor XAMPP over WAMP. XAMPP just contains more stuff. Maybe it's just that when people see X or Z they think "ooh it must be serious ****!", like when it comes to medicine.
Edited by Baniboy (see edit history)

Share this post


Link to post
Share on other sites

OK then,Mamma Mia!!!!There is a lot to take in here, but, nothing but useful advice.(And I am ever so grateful for it).However, Baniboy, you do have a point, if I always look for things that are pre-installed and never try to configure anything myself, I am not really going to learn much.Although it is, in reality, PHP programming I want to learn, I, by no means, turn my nose up for server configurations and system management work and things like that, it interests me all, really.(A pity there are only 24 hours in one day, though). :( I will try to have a look at both WAMP and XXAMP in a bit more detail (hadn't tried XXAMP yet, contrary to WAMP) and compare them regarding ease of use, features and the likes.The only thing that scares me is when I do something wrong somewhere I might mess something up in my PC, which is something I want to avoid at all cost. (After nearly 25 years of marriage, a man obviously wants to limit his headaches to a minimum, your time will come too, Baniboy :D ).But, anyway, having said all that, although it is mainly the study of PHP/MySQL I want to get a grip off, I am certainly interested in all the rest that was mentioned here, too.So, I shall give it all a go.Thank you, folks, and DO expect more questions from me.

Share this post


Link to post
Share on other sites

well bani, i am not sure about which one is better for a beginner WAMP or XAMPP. but i remember reading that in a tutorial before. and i heard the same words from my teacher (the one who is giving us lectures in PHP and MYSQL)that XAMPP is better to deal with for students in beginner level.especially for the ones who are using windows.

Share this post


Link to post
Share on other sites

It may be true that XAMPP is better than WAMP. But when you declare something, you should have the information to back it up. XAMPP also installs Perl, that's where the P comes from, you can also switch between php4 and php5. Nobody uses Perl, nobody uses php4, the extra modules are not what a beginner would need. Next time your teacher says something, ask why.I tried to search up a comparison between XAMPP and WAMP, but all I get is stupid forum threads. And I don't use forum threads for gathering information unless it's something I want to hear people's opinions of.EDIT: correction*It seems that WAMP let's you change the php and apache version too.

Edited by Baniboy (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.