Having trouble running a backup copy of php on Xampp - php

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

Related

How do I upload my Wordpress code files from previous website onto local host Wordpress website which I created via Xampp?

I have Wordpress code files from an old website which I downloaded from WP File Manager that I want to look at on my local host. I have downloaded Xampp and set up a local host Wordpress website.
How do I now upload the code Wordpress files that I have, in the admin section on my local host, so I can see the front end of the website from the Wordpress code files that I have?
I have tried uploading the files via WP File Manager on the local host version, but it does not work correctly, because it has all the code files from local host website, so it's duplicating.
Thanks for your help!
I'm no native speaker, so errors may be excused.
As it states answer and not solution, i'll try to give some directions.
Your question has nothing to do with programming. There are better sites on stackexchange for that.
No need for a new WP instance, as you have a copy of the old one. Put it under your \xampp\htdocs\ folder. I imagine WP will need an appropriate .htaccess file as well, if the File Manager didn't get you that too.
Get a copy (aka dump) of the database from the old instance. Replace all references to the original url with your localhost adress within the dump.
Create a new db on your xampp-setup and import the modified dump into it.
edit the wp-config.php if and where necessary
Hope and pray it'll run, expect errors and further work

Trying to work on a client's Drupal site from my local machine

I have a client who wants me to update their Drupal site. I've never done this before, and I want to work on it from my local machine just in case something goes wrong. I have no idea where to even start!
First off, how do I access my client's site files so I can get them onto my computer? I've tried entering the information the client gave me into Cyberduck, but it won't give me access. Is there another way to get access?
Also, how do I host it locally? I have XAMPP, but I'm not sure how to use it.
That being said, I have found a few forums that should help me set up the local server. I just don't know how to get the files from the live server to my computer.
I know this is a super noob problem, but I could use the help. Thank you!
Well, for the basic question, you have to get the correct credentials from your client. There's no alternative, really :D
While you're at it, you'll want a copy of the site's database too.
For the question "how do I host it locally?" Here's how I would go about it.
Get the site into version control.
Given that you were given (S)FTP credentials, I'm guessing the site is not version-controlled. If that's correct, then that is probably the very first thing you want to do. This will allow you to keep track of the changes you've made on your local site that are different to the production version.
Create an empty directory on your computer.
Navigate to the directory in a terminal and run git init.
Add a .gitignore file to that folder (you can create your own, or use one customized for Drupal).
Download the site's files into the directory created in step 1.
Add the files from the in the directory to the git repository by running this command in a terminal: git commit -am "First commit of Drupal files to repository."
There's a good help page about working with Drupal in git on drupal.org.
Create and populate your database.
Get a database dump from the live site.
Create a new database and database user on your machine.
Import the database dump into your new database.
Record the database credentials in settings.php or settings.local.php and store them somewhere safe, preferably in a password manager.
Change the database credentials in settings.php or settings.local.php to match the credentials of the database you've just created.
(For safety and to avoid confusion, I always create local databases with a different name, user, and password than the live site has. This means if your local credentials are compromised, the live site isn't, and it means you can't connect to and change the live site's database by accident.)
Set up the webserver in XAMPP
Create a new site in XAMPP called e.g. example.local that points to the directory that contains the file index.php
Add the following line the file called /etc/hosts on your computer:
127.0.0.1 example.local
Test that this works in a browser by visiting e.g. http://example.local or http://example.local/robots.txt.
Move your local changes to the Production site
How you will be able to do this depends to some extent on your client's web-hosting infrastructure, and what version of Drupal your client uses. but in any case, you will have three separate concerns for changes you make:
Code changes
You will need to deploy changes you make to the code back to the server. Ideally you would probably do this via Git either by cloning directly into the live site or (far better!) as part of an automated build process. By the sound of it, you may just have to FTP the changes back up.
Be careful not to re-upload your modified settings.php or settings.local.php file!
Content changes
You probably have to test some/all of your content changes locally and then recreate them on the live site. Because your client may have made changes to the live site while you were working, you can't risk importing your local database into the live site.
Configuration changes
Changes to configuration should be managed in code (i.e. as part of 1. Code changes above) if that's possible. In Drupal 7, the Features module is usually the best way to accomplish this (here's an answer I wrote describing the Features workflow). Drupal 8 has the Configuration Manager. Be aware that these two tools can both be tricky to use well.
Your client needs to gave you access to the files so you can put them into htdocs on XAMPP, then you need the database (also provide by the client), start XAMPP, create a new database on localhost/phpMyAdmin and import the db of the site. On the proyect code go to sites/default/settings and change the db settings to your local settings. Then you can go to localhost/{your-proyect} and it should work.

Using MAMP to test online instead of localhost

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.

installing wordpress on IIS using web platform installer

I have installed wordpress on my IIS server using web plaform intaller, everything is working fine when i am working on localhost.
when when i am trying to browse from external or another pc, the links are stayed http://localhost/page.php, which should be http://myserver/page.php
even the styling is not applied because of that.
how do I change the Path and make it work??
Thanks
You will have saved in the database that your site url was http://localhost. To access it from everywhere, I'd use your IP address instead, that way you should be able to see it on your local and external machines.
Do a quick export of your db, open in a text editor.
Find/ replace 'localhost' and change it to whatever your computer's IP is.
Import your changed sql file. Should be all good :)

How to make desired Joomla site working on live server same as on Local Machine?

I have created a Joomla based website and willing to upload it on live server. I have never done the hosting before. please help me how shall i make this happen successfully?
There is a much easier way to do this. Look for a component called Akeeba Backup. Install that on your local Joomla install. Then create a backup of your site.
Now using the backup from Akeeba your can restore your site onto any other server - live or test. The restore feature of Akeeba has a installer that is similar to the Joomla installer.
Very simple, very effective!
Database. You have to export your database from your local machine to the remote one (using phpMyAdmin for example)
Copy files. Copy your local files to the remote server. (using FTP for example)
Configuration files check. Some paths are hardcoded in it, and database credentials might be changed.
See also http://docs.joomla.org/Copying_a_Joomla_website

Categories