Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    72
    Thanks
    4
    Thanked 0 Times in 0 Posts

    installing php, my SQL

    Hello everyone:

    I am newer than a newbie to php. My question is, if a hosting company includes my PHP and my SQL, should I download these programs to my personal computer, or use them through the hosting company. Also, if I should ever change hosting companies, could these files (any database info) be transferred to new hosting company?

    Thanks so much,

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,077
    Thanks
    2
    Thanked 320 Times in 312 Posts
    When learning php, developing php code, or debugging php code, it is always best to do this on a local development computer. The learning/development/debugging cycle will occur faster.

    You will also be in control of the php.ini settings so you can set the error_reporting level to E_ALL (and include E_STRICT if you are interested in writing code that is not dependent on old depreciated functions) and set display_errors on so that php will help you by telling you what it finds that is not correct.

    A lot of code in the learning/development/debugging stage contains security problems. By not doing this on a live server, you don't open the possibility of a hacker taking over.

    Then, only after your code is tested and working, put it on a live server.

    Any of your files or databases on a hosting server can be backed-up/copied and moved.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • Users who have thanked CFMaBiSmAd for this post:

    ds67 (05-09-2008)

  • #3
    New Coder
    Join Date
    Apr 2007
    Posts
    72
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks so much CFMaBiSmAd. This has been helpful (as simple as it may seem to you). Would you (or anyone) suggest using a local computer to create database using my SQL or setting it up through my hosting company?

    Thanks again,
    ds

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,077
    Thanks
    2
    Thanked 320 Times in 312 Posts
    For development purposes, setup mysql on your local computer as well.

    There are several all-in-one Apache/php/mysql packages. The most up to date is XAMPP - http://www.apachefriends.org/en/index.html
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    bdl
    bdl is offline
    Regular Coder
    Join Date
    Apr 2007
    Location
    Camarillo, CA US
    Posts
    590
    Thanks
    4
    Thanked 83 Times in 82 Posts
    If you intend to use MySQL on the web host (and I'm sure you do), you'll still need to setup the database on the host regardless of whether you do so on a local machine. I recommend getting the database structure and queries down first with some sample data, then transfer the empty structure to the host. It is also rather important that you understand SQL and the relational model before you venture to add any queries to your PHP code. The MySQL manual is invaluable and there is a relatively good tutorial.

    While we're on the subject, the PHP manual is also the best reference you'll find.

    Something that wasn't mentioned but is very important; make sure you match versions and configurations as closely as possible between your local machine and the host server. You don't want to have an entire application built around the latest bleeding edge versions of PHP & MySQL (and Apache, if applicable) and find out afterwards that your host is still using older versions.

    If possible, sign up with a host that does have PHP 5 and MySQL 5, the most current versions; you'll find you have much more flexibility with these versions and eventually be able to do more.

  • #6
    New Coder
    Join Date
    Apr 2007
    Posts
    72
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hi All:

    Like to thank everyone who tried to help me. I've been working on this Apache/php/mysql ALL DAY! I've tried to download them individually, I've tried the 'Apache Friends' all in one download. I keep getting a message something about the TCI/IP port 80 thing. Have no idea what I'm doing. Thought it could be done, but I guess I'm an *****. I'm exhausted

    Thanks anyway.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The port error occurs if you have a program running on that port. Usually instant messagers like Skype and Yahoo take up these ports. Its also possible that your previous installations didn't remove apache and it may still be running.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    It is good to do the development and testing on a local setup before uploading, as the process is faster and more secure,

    One of the all-in-one packages is useful for getting up and running quickly, but I think it is better to install and configure the components (Apache, PHP, MSQL, etc) one by one, since you learn more that way. I've used this tutorial as a reference whenever doing this on a new PC - it is fairly current and very helpful.

    For the port issue, this can happen if you have IIS or some other programs installed, as mentioned. After installing Apache, you cold try changing its port number to something other than the default 80, so as to remove the conflict.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •