I've made a mess out of my MAMP setup. I used it all the time for WordPress and Drupal work, but now I want to try and learn Rails. After trying to get Rails installed, I now have 2 versions of MySQL competing with each other—and of course neither works anymore.
So: I'm wondering what the 'proper' way is to set this up so that they play nicely together.
Advice on setting up a 'proper' Mac OS development environment for PHP and Rails extremely welcome.
Thanks
Terry
Using Homebrew and RVM is the only way I recommend setting up a Rails environment on OS X these days. Homebrew gives you a really easy way to install and upgrade applications like MySQL, and RVM makes installing and working with Ruby a breeze. As far as working with PHP and Apache, you should be able to use the Homebrew MySQL install with the existing MAMP setup, as long as you turn off MAMP's MySQL server.
The only other thing you may need to do is install Apple's Xcode developer tools in order to compile the various packages.
Like someone wrote in the comments I will take the VM approach anytime. Just run a linux distribution in a virtual machine with all the modules you need. You can even run/ test different environments. Easy to setup/ upgrade/ replace and you don't have to fiddle around your working os.
I run osx (working environment) and a debian server installation in a virtual box as my webserver (running apache, php, mysql, rails). I switched over from a MAMP configuration and it saved me alot of stress and work (Think about upgrading different MAMP components, really is a pain sometimes)
Related
I understand LAMP, MAMP and XAMP are solution stack. I also understand there are frameworks like Laravel and Symfony.
If I have to start PHP development in a proper manner, Is it required to have a solution stack installed first and then the framework to have a professional set up?
If the answer is yes, then I am assuming the versions of the software inside the package is quite important for compatibility with the framework. Is there a popular combination out there?
And In Live, I suppose, I just to need to have the solution stack installed for the package to run.
My dev machine is a MAC with OSX 10.9.5 and my Live is going to be in Linux. I need to make sure these fundamental knowledge is concrete before I start the work. Any help is much appreciated.
Laravel has a all-in one virtual box solution. It's called as Homestead. Homestead works on many platforms such as Linux, MAC, Windows and contains everything you needed:
Ubuntu 14.04
PHP 5.6
HHVM
Nginx
MySQL
Postgres
Node (With Bower, Grunt, and Gulp)
Redis
Memcached
Beanstalkd
Laravel Envoy
Blackfire Profiler
If you decide to go with other solutions you will probably face with many problems like enabling essential extensions and with changing some system settings.
Besides you can use this solution for pretty much every kind of php framework or code.
Just follow the steps in the guide and almost everything will be ready to use just in few minutes after download finishes.
Laravel is good choice as there is big community and Google trends show it is growing very fast.
As it is PHP then you need to have server which processes the PHP. Usually it is Apache2.
Many people like to use MAMP, XAMP to simplify their development. I prefer to use standard Apache2 myself and you can even just rely on Laravel/PHP builtin server that you can start with php artisan serve, It will be enough for defelopment purposes.
I recently bought a new mac... In the past I used MAMP and Bitnami for the setup of my dev environment, but I would like to find a more efficient way, if exists, to manage my apache & php installation...
So...
What is the best way to set up a PHP development environment on a Mac? On StackOverflow I found something on http://www.macports.org/ are they reliable and/or updated to latest versions of apache and php?
I am one of the BitNami developers. I wanted to mention we have released a version of MAMP stack that you can download and run from Mac OS X app store with one click. It is completely free: https://itunes.apple.com/app/mamp-stack/id571310406
I finally found my perfect setup thanks to this blog post: http://echodittolabs.org/blog/2011/09/os-x-107-lion-development-native-apache-php-homebrew-mysql-or-mariadb, which basically uses Lion's built-in Apache and PHP with a Homebrew installation of MySQL and a nice VirtualHosts setup.
You can try AMPPS new MAMP/WAMP Stack. I use it.
I've installed Apache/MySQL/PHP on linux servers several times, and it's usually a piece of cake because of good package managers.
However, I had a terrible experience with MacPorts. Why don't you look at Xampp if it has everything you need.
I think I'm going for an Ubuntu Virtual Machine, for several reasons...
Easy to mantain (all packages available)
Easy to shutdown
MacOS stays clean
I can easily switch env or similar...
For Windows users i recommend "Softaculous AMPPS" since it's easy to update it. For Mac users I recommend "Bitnami MAMPStack". However to test PHP mail function on my Mac, i use "MAMP Pro".
Do you guys recommend using MAMP, or should I go about a manual install? I am savvy enough to do the install manually (I have done many manual Apache installs with Ruby on Rails in the past), but I am not sure if MAMP is worth it.
Any guides, tips, or opinions are welcomed, as well!
UPDATE
This will be used for development purposes. Speed/Efficiency is not the most important thing. As long as php/apache/mysql are all available, I should be okay.
Keep in mind, MySQL has already been installed (using Homebrew), and I prefer to install mysql/postgresql that way.
Thanks!
Follow the instructions on this page, works perfectly fine.
MAMP is good, but it's gonna install everything from scratch. The same goes for PHP via homebrew. I have tried all of those. But you have to remember that your Mac comes bundled with Apache and PHP out of the box. You just have to add MySQL to the mix and get rolling.
Mamp is easiest but without paying for pro, virtual hosts are difficult to manage.
I found the default version already on the system a pain to manage due to some osx specific config in apache's httpd.conf. But you can use mac ports or homebrew (my preferred) for a custom php/apache install.
My preferred and in my opinion the cleanest way is to install virtualbox and run a full LAMP stack. This is the most flexible and a lot closer to anything you may be hosting on. If you havent done any sysadmin before it is a pretty good way to learn a bit more
I have Windows 7 Enterprise and I want to run a web server on this computer and I wander what is the best web server would be in my case. I have several requirements to the web server.
It should be easy to install and set up the server. Just "click", "accept" and that's it.
It should support MySQL and PHP (with GET, POST, SESSION, and cookies).
I want to be able to install the server from CD or memory stick. In other words, I want to be able to download something on my CD and than use this CD to install the web server.
The server (software) should not occupy a lot of memory.
It should be possible to install the web server on Linux, Windows and MAC.
Install Z-WAMP. It has the latest versions of Apache, MySQL and PHP (with APC and phyMyAdmin). It's also portable so you can have it installed on a mem stick.
XAMPP is very simple to install and use.
Quoting:
Zend Server Community Edition is a fast and reliable PHP application stack. It is completely free, and you can use it in development, testing and production.
Further:
Eliminate wasted time spent on putting together your PHP stack piece by piece. Zend Server Community Edition includes everything you need, whether you’re using Windows, Linux or Mac OS X. The simple, native installers will set you up in minutes with:
Bytecode accelerator (Optimizer+)
Zend Data Cache
A certified PHP distribution
Zend Framework
Apache (or IIS integration)
MySQL (on Windows and Mac OS X)
Out-of-the-box connectivity to all common databases
Java code connectivity
Web-based PHP administrator console
Not quite sure if this is what you mean but take a look at AppServ it installs Apache, PHP and MySQL for you with one installation file.
If you combine requirement 1, 3 and 5 you make it extremely difficult.
There is not just one package that you can install on boot *nix and windows. Simply because they use a different Operating System with other drive mappings, libraries, etc.
But for Windows I recommend one of the XAMP/WAMP implementation (I'm not a Windows User). For Mac there is MAMP. On other *nix based systems I always used predefined packages or a manualy compiled amount of packages which does not meet your requirements.
Latest OSX has buildin PHP and Apache. You only have to enable Apache in your system pref panel. MySQL can be installed.
It's also possible to use XAMPP for osx. Can be installed from CD
As for Windows you can use WAMP or XAMPP. This package includes Apache, PHP and MySQL. Can be installed from CD.
Most Linux distro's have apache build in. And it's easy to configure PHP and MySQL for it. You can also use XAMPP for linux:
LAMP for linux
XAMPP for mac
and WAMP for win
Different gui almost the same thing easy to setup and configure.
The big advantages with WAMP are that you can easily switch PHP/Apache/MySQL version and toggle PHP settings + extensions, directly from the taskbar.
That's why I'm using it.
Note: Even though you can't download the latest PHP version from their site, it's very easy to install it yourself.
I've found myself down a rabbit hole and would like advice. It looks like Mac OS X 10.5.8 comes bundled with a pre-configured version of Apache 2.2.11 (located in /usr/sbin), PHP 5.2.10 (located in /usr/bin) and subversion 1.4.4 (located in /usr/bin). I have installed MAMP for MySQL 5.0.41 (located in /Applications/MAMP/...) which comes with Apache 2.0.59 and PHP 5.2.6. The current version of MySQL is 5.1 (mysql.com). I have also installed the latest Subversion binaries 1.6.5 (they get located in /opt/subversion/...). This is becoming a mess. Ideally I would like to have one copy each of Apache, PHP, MySQL, and Subversion and have them all be the latest release and have them work together properly. Are there configuration pitfalls specific to the Mac that I need to watch for if I install the newest binaries of Apache in /usr/sbin, PHP5 in /usr/bin, subversion in /usr/bin, and Mysql in /usr/bin (or /usr/local/bin)? Am I just asking for trouble?
Do not install ANYTHING in /usr/bin or /usr/sbin. Those are managed by Apple and you can get yourself and your system in trouble when you start modifying stuff there. Other than a bit of wasted disk space, there's normally no problem with having more than one copy of things like Apache. Just accept it.
If you need newer or missing versions of open source packages, you might want to look into using MacPorts or Fink to supplement what's provided by Apple.
My personal preference is just not to do this development on my Mac at all, and instead run a Linux Virtual Machine using VMWare Fusion, VirtualBox or similar. One of thes nice things about VMWare Fusion 2 (not 3 though, bizarrely) is that you can run these virtual machines in headless mode, and simply SSH into them via terminal on your Mac.
The benefit to me here is that my VMs are able to very closely mirror the setup of my production machines, I'm able to closely control what software is actually installed on them, and if I need to work on a new machine I can simply copy the VM from one machine to another. I can also easily take snapshots of the VM at any point, and roll back to them if I do manage to muck something up.
Here's a good guide to using VMWare Fusion for doing development on OSX.
I have been developing for the LAMP stack on a Mac for bit over 4 years now. I have tried pretty much every flavor of the stack on the Mac.
Native: Not viable, because it's an old codebase.
MacPorts: I ran into trouble with OS X updates.
Self Compiled: Same as with the MacPorts, I ran into trouble with OS X updates.
MAMPP: I didn't like this package, yet this is a personal dislike. I kind of disliked it's freemium like style. The package is not easily configurable, except using the commercial configuration software.
XAMPP: I ended up sticking with XAMPP.
About XAMPP:
The XAMPP code base is rather up to date. With the Developer Package, you get all the tools necessary to compile additional extensions. Everything is configured in /Applications/XAMPP/etc/.