Using MAMP to test online instead of localhost - php

I'm new to PHP and everything, so I'm trying to learn some things.
I'm currently developing my first PHP site in Dreamweaver using MAMP and Localhost.
I have already bought my domain name, and built a smaller html site just to act as a "holding site" before the PHP one gets put up. I'm wandering if instead of using localhost, that I could use a subdomain of that domain. So instead of going to localhost/mysite I could go to test.mysite.com.
Tell me if I'm wrong, but I shouldn't have to upload any files to GoDaddy because I'm using MAMP as the server. Right?
Keep in mind, this isn't permanent. I'm not planning on hosting my site on my computer using MAMP. I'm just wandering if it's possible and how to do it if it is.
Any suggestions, comments, or answers are greatly appreciated.
Thanks.
- Ryan

MAMP is not the server. MAMP adds server capabilities to your computer, but you can't use MAMP to mimmic any server.
What I recommend you is working on your computer, with MAMP and using localhost as the "test address". After the page is finished in your localhost, and everything work fine, you can upload your page to your server (with FTP). This way you avoid having to upload your files via FTP every time you make a change in your code.
And welcome to the PHP World. Countless mugs of coffee and restless night await you.

You can create some folder on web server(on your paying hosting) and upload all files from your test localhost folder. Everyting would work perfectly if you type: https://yourwebsite.domain/yourfolder. If you want to set it to view like http://yourfolder.yourwebsite.domain you must from Control Panel set up an some subdomain. Subdomain is make something like this: you enter name of subdomain and folder which is mapped to that subdomain. For example, you set up subdoman http://test.web.com and map that to http://web.com/testfolder.
I hoppe that I help you.

Related

Having trouble running a backup copy of php on Xampp

I uploaded a php script to a subdomain that I own, for testing and customizing purposes before it goes live (I had planned on moving everything over to the root domain when done).
Someone then suggested that I work on in Xampp instead as it is all locally installed and therefore much faster, etc.
Thing is, I had already customized the script a lot (mostly CSS but also uploaded graphics via the admin panel, etc) while it was up live on the web host, so I would like to run a copy of the most up-to-date version of it in Xampp and continue customizing it from there.
I downloaded a copy of all my files by FTP into htdocs > Test folder. I also downloaded a copy of the database via phpmyadmin and imported it via phpmyadmin into my localhost.
The big problem I have is when I try to access the scritp via localhost, the url immediately reverts back to the live url. How do I set it to link to the local host copy instead?
Thanks.
Based on AbraCadaver's suggestion, I found the answer lied in changing the URL parameters in config.php
Thanks

Creating a test environment for an existing website

So I have an employer who currently operated their website with no testing server whatsoever. All updates to the site are "tested" live in front of the whole world. I don't need to hear about why that's dangerous... I know it is. In fact if this continues for much longer I'm going to develop an ulcer.
I am trying to place a working copy of the svn of the site on my MB pro for testing purposes. The site is all PHP and MySQL so my plan is to install MAMP and run the test copy on localhost.
My employer is worried that by hosting a copy of the site on my laptop I will interfere with the operation of the live site. Is this possible? Is there any way that my hosting a copy of the site on localhost will interfere with the operations of the live website (hosted on a remote server)? Are there dangers in setting up a localhost copy?
Apologies if this is out of scope, hopefully this will be useful to others.
It depends on the site. When I make a site and the database is hosted on localhost / the same server as the web-server, no.
But I have noticed that if you use for example WordPress, you are testing on your local copy one minute and are on the live site the next as the url seems to be hard-coded in the generated pages (in the case of WordPress a setting in the database).
So:
Always make sure the database connection is to your local database (ideally that is just in one place and you don't have to change anything if the live site uses localhost as well)
Look out for links / settings / rewrites that direct you to the live site from your local site.

Connect to a non locally hosted database when using MAMP?

im looking to launch a site soon that will have lots of user data on it.
For easier testing and uploading etc for changes i want to know if i can work on my MAMP site, whilst using directly the database from the live site?
Thanks.
I recently used MAMP and my database connected fine from one at the hosting company (not locally) if you use Joomla you can change the configuration.php file to point to your live database.

Hosting a website created with xampp

I have spent some time designing a wordpress/phpbb site, and hosting it on localhost using xampp. I would like to soon host my website on a real domain, but I am not sure what I would have to do and change in order to make it a success. Is it possible to just use the files I have placed in htdocs inside the xampp directory?
Thanks for your help, and sorry if my question is confusing or badly explained.
Yes it is, that's the point of XAMPP - website prototyping. I assume that by real domain you mean a hosting service. If you also use MySQL make sure you copy all data to the new database and check PHP dependencies with the new host.

Wordpress site doesn't work in localhost running in android emulator

I just want to learn how to build responsive themes and I installed the android emulator on win7 and all is ok when I test sites which are running on a live server. The problem is that is not working when I try to test wordpress sites from WAMP server. I'm using 10.0.2.2 instead of localhost or ip... It's working for simple html files but not for wp. It shows me a sitemap with all the site pages and when I try to click on one of them it shows me an error "The webpage might be temporarily down...".
I need to test them on WAMP server before uploading them on a live server. What should I do?... When I uplaod them on server, (the same theme), all is working. Could be something wrong with the wamp configuration?. I test it on 2 pc's (32 and 64) and the same is happening.
I found http://www.youtube.com/watch?v=ZR6E9I0PKoI video and there I see that it's working for him. What am I missing.
Thanks for your help,
Florin
UPDATE
I tested the instructions on the video and they worked fine; I was using WordPress multisite and didn't work, so I created a standalone setup and it worked :)
Here's a simple solution I tested and working for debugging WordPress themes on Android.
First you have to be able to access your localhost from your mobile, follow this instructions here.
Now you should be able to access your localhost from Android. Since WP is redirecting addresss like http://192.168.0.100/wordpress/ to something like http://localhost/wordpress/. Better create a directory on your www folder and test your html versions of styles until they suite your responsive needs.

Categories