Pre Purchase Question |
Guru master
|
With all of the PHP sites that I develop, they can be easily copied to a new server and used with any domain name. I then know I won't have any problems moving between development, staging and production.
I never use localhost as a domain name for web site development as I find it causes various issues. For example, a lot of community PHP code (eg CMS systems) will not work with localhost (a lot of domain related code requires dots in the domain name), having to use sub-folders for each site to keep them separate, problems with cookies and it can also be very untidy. You should find it possible to develop a web site without any internal fixed references to the domain name and using internal fixed references would almost certainly be considered bad design. For example, the site could use /page.php instead of http://www.domain.com/page.php and then the browser would use whatever domain was being visited. However, you might not be able to do that if you are using localhost with a sub-folder for the development site. Get away from using localhost, then you can stop using sub-folders for each site. You will need to learn a little bit about Apache configuration to do that, but it can be easy. Another option is the Windows hosts file, which is normally stored somewhere like c:\windows\system32\drivers\etc\hosts and is just a text file that maps domain names to IP addresses. So you could for example assign www.domain.com to 127.0.0.1 and that will then bypass DNS. You can also uses hosts to create your own internal domain names, such as mywebsite.local (always have at least one dot in your own domain names). PhpED has really useful FTP features for updating sites, etc. but it is not a backup application. You might find a full FTP application better, such as FileZilla (free and good) or SmartFTP (my personal favourite). Backing up databases could be done with a bit PHP code on the server to create a dump file, which you can transfer with FTP. There are even PHP scripts around that will dump the database and files into a compressed archive, so you can transfer just a single file with FTP (much faster). If you are using DreamWeaver to develop PHP, good luck! I used to love DreamWeaver, but I hate it these days. I use PhpED for nearly everything and don't even find much of a use for visual design tools. I find it better with something like Firefox with FireBug and then adjusting CSS. The results are consistently better across different browsers. Once you get the PhpED debugger working, you will hopefully find it quite liberating and it will make your development and learning much easier. The answer to your final question is YES, it is perfectly possible for PhpED to run a copy of a live site locally with a debugger and no changes, as long as you fix the issues with your domain name usage. However, PhpED comes with both an integrated web server called SRV and also the ability to work with the Apache web server with the PhpED debugger. Stick with Apache because I found SRV does not give a compatible web environment compared with Apache. |
||||||||||||
|
|
HI thanks for the reply
OK to clarify my live website does not have any references to localhost but it does have a lot of references to the absolute domain name for things like links to gif files and on the navigation bar etc. Things like www. domain .com/ images/ whatever.gif in href and img tags etc. The only way I got a test version of the site running locally on my currect setup was to edit all these absolute links to say localhost/ instead of domain com. This is most certainly due firstly to another programmer who I originally paid to work on the site who should have known better, and also down to me who started from nowhere 18 months ago so didn't know better about using relative links and didn't know any other way to get my test site working other than change the links to localhost instead It has occurred to me either I need to go through all the php, html files and custom templates (stored in the database) and change all the absolute links to relative ones - I guess I could use 'Actual Search and Replace' to find them all - the ones in the database I could find them in a sql backup, edit them and then restore it or use phpmyadmin to change them? The other option I guess would be this windows hosts file you mentioned. Let me just get this straight in my head, am I right in assuming that would stop the PC running the apache server from accessing the live site and 'redirect' www domain com to the localhost 127.0.0.1 instead when I use a browser on that PC? So I enter the domain name as normal but end up connecting to my local server and test site? From the two I guess changing all the absolute links I introduced to relative ones would really be the best way to resolve my problem, though a little time consuming? Regards FTP programs I use WinSCP to upload to my live site - don't know how it compares with your favourite but it certainly works for what I need it to do Thanks Rich PS whay do I have to put spaces into things like www domain com to get them to display here otherwise I see yellpw triangles with ! in them - but in your answer you obviously don't have this problem? |
||||||||||||
|
Guru master
|
Hi,
It sounds like you are thinking along the correct tracks Exporting/dumping SQL, editing it and importing it can be a very convenient way of fixing up a database. Changing absolute to relative would probably be your best long term approach. On Windows the hosts file allows an IP address to be assigned to a domain name at a very low level, so most if not all software on that Windows computer would use 127.0.0.1 instead of the real address. Indeed, you will normally find that file contains the assignment for localhost! Bear in mind that most web browsers cache IP addresses within the browser for a period of time, so you might need to restart any running browsers. This forum used to get a lot of spam and still gets the occasional ones. It limits 'features' according to the number of posts you've made. After you've done a few posts you will be able to post web addresses, links, etc. |
||||||||||||
|
|
Right then - With that in mind, I'm going to take an up to date backup of my entire stes files/folders, plus a database backup and see that I can do with these absolute links
Once I have that running I'll be back asking how to set up phped to work with my test site Thanks Rich |
||||||||||||
|
Pre Purchase Question |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by