Our forum Area

Results 1 to 3 of 3

This is a discussion on How can I test a PHP/MySql/ web site on a locally installed server? in the Website Management forum
Question: How can I test a PHP/MySql/ web site on a locally installed server? Why: I have a domain that was backed up as "Full ...

  1. #1
    Loyal Client
    Join Date
    Apr 2007
    Location
    Earth - it is temporary too.
    Posts
    353

    How can I test a PHP/MySql/ web site on a locally installed server?


    Question:

    How can I test a PHP/MySql/ web site on a locally installed server?

    Why:
    I have a domain that was backed up as "Full Backup". All my clients using any MySql lost their databases. Unfortunately, this domain it cannot be restored to the server by the server techs because "It was not created using cPanel". Take my word for it. This isn't about that. I need to set up the site as it was before the MySql fiasco. Clearly, I need to do this locally so I can pick it apart and use what I need to rebuild it.

    Details:

    1. I have a clients domain that has been created with "Full Backup" from cPanel - now won't install by server host.
      This domain includes 2 MySql databases, and uses PHP, CSS and, Jooml 3.#
      The site also includes 3 email addresses.
      This site was installed, and running on the server.
    2. I have successfully installed and run "XAMPP Apache + MariaDB + PHP + Perl" locally.



    Summary:
    Without reading through 1000s of pages and forum discussions, there seems no easy way to marry up the site to Apache locally so, do you have a way of un-compressing the site contents so it can be run and tested, repaired etcetera locally on a Windows box?

    Rambles and other useless stuff:
    I already extracted all the site files to a local folder.
    Of course running index.php doesn't work.
    This is not a question for Jag techs to fix something, rather it's a question to peers about an idea.
    Darned right I am in a hurry - I expected your answer yesterday
    This domain also used several Joomla extensions.
    I need more than just the images (those I can get), I need the dbase contents, as well. Importing the dbase to a new site is too cumbersome - it would be like building a site while wearing a blindfold.

    Thanks for reading, and ...

    i
    ~He will always be my best friend, and was a better human than most people I know. Boomer - June 15 1994 - May 9, 2008~.

  2. #2
    Loyal Client
    Join Date
    Aug 2007
    Location
    Coventry, England
    Posts
    81
    Testing a site locally (or on a different server than the production server) is fairly simple if you know what you are doing.

    The main thing that prevents you testing sites is the way the CMS rewrites URLs so, unlike with static web pages where (provided you used relative rather than absolute links) the site would work either as http://mydomain.tld or http://sharedserver.name/~mydomain or even just accessing the files directly on the test machine, with CMS systems they generally only work correctly if you use the correct address as configured in the site setup.
    The easy way round this, which also works for testing sites when moving them to a new server before updating the DNS and dropping the old server, is to temporarily add entries on your test client machine so that rather resolving the domain name to it's normal host it redirects instead to your test server.
    On a windows machine you just need to edit the file C:\Windows\System32\drivers\etc\hosts and entries like:

    Code:
    192.168.1.1  www.mydomain
    192.168.1.1  mydomain
    replacing the IP address with that of your test server. Remember to remove or comment out these lines once you have finished testing. Provided it has been set up correctly as virtual domain in apache on your test server everything should then work as expected. Note I would usually recommend testing the site from a different machine to that which the test site is on, also if your normal server is linux then I would suggest you are better off using a linux machine as the test server. Any old pc, or even a raspberry pi would suffice for this purpose.

    As far as extracting the files from the archive is concerned on windows 7-zip ( 7-Zip ) can handle .tar.gz files If you have done full backups then the sites sql database(s) should be included in the archive so it should be possible to recreate the original database.

  3. #3
    Loyal Client
    Join Date
    Apr 2007
    Location
    Earth - it is temporary too.
    Posts
    353

    Ta

    Quote Originally Posted by bloodycat View Post
    Testing a site locally (or on a different server than the production server) is fairly simple if you know what you are doing.
    ....
    Well, having lots of sex is easy too if one knows what they are doing

    Many thanks and today I am going to follow through on your suggestions. When it works, and when others say "Wow! Great - you got it going.", I'll just say "Yep - helps if you know someone that knows what they are doing"

    Wish me luck and thanks a gazillion,

    i
    ~He will always be my best friend, and was a better human than most people I know. Boomer - June 15 1994 - May 9, 2008~.

Bookmarks

Posting Permissions

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