jon9china Posted December 31, 2015 Share Posted December 31, 2015 I currently test changes to my javascript and templates by setting up some 'dummy' pages and 'dummy templates', and uploading everything to the server. Is there a way to replicate my site on my local machine, so I can do away with keeping track of versions of my templates and other complexities? I will be working on a Mac. The easier the solution, the better, as I am not well versed with back-end technologies at all! Thanks! Link to comment Share on other sites More sharing options...
szabesz Posted December 31, 2015 Share Posted December 31, 2015 (edited) I found this one to be the easiest to use: https://www.mamp.info/en/ You can find a lot of tutorials on the net on how to set it up. There are alternatives too, for example: https://www.apachefriends.org/hu/ Edit: and if you want to move it later on: https://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page5 Edited December 31, 2015 by szabesz 2 Link to comment Share on other sites More sharing options...
arjen Posted December 31, 2015 Share Posted December 31, 2015 Hi jon9china, Martijn wrote a great tutorial about a setup which works great. I use the same configuration with a few minor tweaks, but it has been running smooth for more than a year. When running a newer version of Mac OSX you might want to tweak some stuff since Apache has been updated to 2.4. 1 Link to comment Share on other sites More sharing options...
horst Posted December 31, 2015 Share Posted December 31, 2015 Another approach can be to setup a dev-subdomain on your online hosting provider and use an editor that provides editing of those files directly via ftp(, sftp, ftpes) behind the scenes. This has been discussed sometimes here in the forums too. Good google searches for that can be: site:processwire.com/talk -"Viewing Profile" mac editor ftp It depends on your hosting account, if there are resources for: 1 additional DB and the possibility to create subdomains, e.g. a dev.example.com besides the www.example.com. 2 Link to comment Share on other sites More sharing options...
jon9china Posted December 31, 2015 Author Share Posted December 31, 2015 Thanks a lot. This is all great information. I think I'm going to try going the route you suggest, Horst. I followed a couple of those relevant threads and think I'll start exploring some of those tools. It seems like a solution I can wrap my mind around, and a cleaner way of doing what I'm already doing. 1 Link to comment Share on other sites More sharing options...
jon9china Posted December 31, 2015 Author Share Posted December 31, 2015 What is involved in copying my processwire site to a subdomain, aside from copying the files and making a copy of the database? Link to comment Share on other sites More sharing options...
horst Posted December 31, 2015 Share Posted December 31, 2015 In short: nearly nothing more! If you have an exact copy of your origin Database as second DB you only need to change the credentials in site/config.php to point to the dev-DB. Besides that, you should copy the index.php, .htaccess and complete wire and site folders to the dev.domain. That's it! 2 Link to comment Share on other sites More sharing options...
jon9china Posted January 1, 2016 Author Share Posted January 1, 2016 Seems I've missed something. Getting a 500 internal server error. Copied folders and files as described, and used phpadmin to export my database and then created a new db and imported the exported one. Modified the site/config.php file to point to it (tried pointing to original database, too), but getting the internal server error. Are there some permissions that need modifying? also I see something in the config file: $config->httpHosts = array('www.mysite.com', 'mysite.com'); should this be modified to specify the subdomain? (though I did try it and it did not fix my internal server error) Link to comment Share on other sites More sharing options...
horst Posted January 1, 2016 Share Posted January 1, 2016 (edited) Hi @jon9china, hhm, yes, sorry. The httpHosts array needs to be changed to (at least) include the new hostname too. (Or is set to only hold this domain name). It is for security reasons, but this isn't the reason for the 500. Regarding the 500 internal error: You need to check write permissions for folders and files under site/assets/. (Including the assets folder itself.) PW needs write access to create / delete subfolders and files. During installation you have defined chmod values for files and folders for that, it is noted in your site/config file. (e.g. 0755 and 0644, or 0777 and 0666). Check if files and folders in the subdomain are assigned that way. Also, if the 500 is gone and you can access the admin but get some errors there, you should go to -> modules -> refresh (search for new). PW uses cached informations for all modules (installed and uninstalled ones), including pathes. This needs to be recreated, too, if it isn't automatically. Please report back when all is working ok, or if there is anything other that doesn't fit. PS: here is little troubleshooting guide from Nico, regarding regular installation processes: Doesn't fit in your case, as your orig site is already running, but maybe is nice to have bookmarked for future installations on (foreign) hosts.(?) Edited January 1, 2016 by horst 1 Link to comment Share on other sites More sharing options...
jon9china Posted January 2, 2016 Author Share Posted January 2, 2016 Not sure what's the problem. I really appreciate the help. But still getting the 500 server error. Permissions seem to be right on folders and files. Also checked the dev site against the operational one, and files and folders match accordingly (0755 and 0644) Fortunately not an urgent problem for me right now. Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 2, 2016 Share Posted January 2, 2016 Depending on the setup of the server as subdomain might need another rewritebase in the .htaccess file. 2 Link to comment Share on other sites More sharing options...
jon9china Posted January 21, 2016 Author Share Posted January 21, 2016 Back to this thread again...I still haven't gotten a setup working. I've tried installing MAMP on my Mac mini but am getting server error there, too. I modified the config.php file in the site folder: $config->dbHost = 'localhost';$config->dbName = 'name_of_my_db';$config->dbUser = 'root';$config->dbPass = 'root';$config->dbPort = '3306'; and copied wire and site folders to the htdocs folder in the MAMP application folder, along with index.php and htaccess files, and imported the database. If anyone knows what part of the recipe I'm missing, I'd appreciate the kind help! Link to comment Share on other sites More sharing options...
szabesz Posted January 21, 2016 Share Posted January 21, 2016 What sort of errors are you getting? You can find the log files here: /Applications/MAMP/logs/apache_error.log /Applications/MAMP/logs/mysql_error.log /Applications/MAMP/logs/php_error.log or just use MAMP's Log menu. 1 Link to comment Share on other sites More sharing options...
jon9china Posted January 21, 2016 Author Share Posted January 21, 2016 Thanks for reply, szabesz. Here's what I find in the php.error.log, which doesn't sound like a fatal sort: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Wire has a deprecated constructor in /Applications/MAMP/htdocs/wire/core/Wire.php on line 47 No errors in the other two logs. but comes up on MAMP website page: 500 Internal Server error Suggestions? Link to comment Share on other sites More sharing options...
szabesz Posted January 21, 2016 Share Posted January 21, 2016 (edited) I guess you have an up-to-date version of MAMP (which I do not have at the moment since I do not upgrade MAMP too often) https://www.mamp.info/en/downloads/ And reading the sidebar, it ships with PHP 7.0.0 too. Do you happen to use it? I run ProcessWire 3.0.5 on PHP 5.6 and do not have any "deprecated notices". Anyway, since it is just a "deprecated notice", it should not be the cause of a 500 Internal Server error, but you might want to try switching to PHP 5.6. Have you tried to install ProcessWire from scratch, so that you can see if that works? Edit: PHP 7 maybe just an optional addon, and it does not yet ship with it. Edited January 21, 2016 by szabesz 1 Link to comment Share on other sites More sharing options...
jon9china Posted January 21, 2016 Author Share Posted January 21, 2016 Doing a fresh install of processwire to test sounds like a good idea. Maybe I will give that a try. Link to comment Share on other sites More sharing options...
OrganizedFellow Posted January 21, 2016 Share Posted January 21, 2016 I know you are looking for a simple solution. I have not tried, but have heard some greatness about Caddy Server https://caddyserver.com/ > Available for Windows, Mac, Linux, and BSD. > https://caddyserver.com/developers Their page shows lots of great features. May be the simplest way for you. I will also give it a shot on another computer of mine as I currently run a full LAMP stack on my desktop. Please let us know how it works for you! 1 Link to comment Share on other sites More sharing options...
jon9china Posted January 21, 2016 Author Share Posted January 21, 2016 Perhaps I will give it a try. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now