(LMX)AMP and Laravel - php

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.

Related

Build a MAMP environment on Mac... Best solution?

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".

Proper Mac dev. environment with Rails and PHP

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)

Using Mamp or another package vs manually enabling PHP and installing MySQL on Mac 10.6

What are the benefits of installing mamp or another package vs enabling php in httpd.conf and manually installing mysql? I am really not sure of which option is better and would love some info.
Thanks,
MAMP and other packages are usually pre-configured and come with other tools like phpMyAdmin, SQLite Manager, SSL, code optimizers. If you think you're handy enough to do what others have done, go ahead. But it'll save you a lot of time and trouble by grabbing what's already available.
I've used MAMP for over two years now and I love it.
For me, I didn't want to configure PHP and MySQL with Apache. On my old computer I installed MySQL and then phpMyAdmin and had a lot of fun trying to get it all working. (But I'm not good with terminal and bash commands)
I installed MAMP on my new computer just because it does all the work for me. When I want to debug a php script, I just fire up my local server and make a few changes.
Imo, MAMP/WAMP = Easy get up and go in a development environment.
If you are running a business critical app, you may be better off with a LAMP stack

Getting started with PHP on Windows

I'm getting started with a side project that will be developed using PHP and I'm looking for guidance on getting my Windows machine up and running and ready for development (as quickly as possible). Being that PHP development is more geared towards Linux users/developers (which I am not), I'm trying to figure out how to get all the pieces in place to get a 'WAMP' stack operational locally on my Windows machine.
Any good tutorials/quick start guides out there and if not, does someone have all the steps that they could provide me with here?
Install Apache Friends XAMPP.
PHP on Windows:
Install Xampp because it is really easy to install.
Use version control system like for example git to store your code.
Use an IDE like netbeans/eclipse/aptana for faster PHP development(autocomplete, code formatting, PHPdoc, etc).
Learn a PHP framework like for example codeigniter to ease your development. The video/screencast to create a blog in 20 minutes will learn you how to use it.
Practice TDD to test your code, which will result in more stable code-base.
Good luck coding!
Learning Linux/Ubuntu:
As a sidenote when installing ubuntu which is really a straight forward process you will see that using linux isn't that difficult as you think(It used to be difficult compiling source manually etc). when you install a dual boot and play with every day. I guarantee you that in no time you will really love linux like I do. I really think linux is the best option for coding. Also redis main creator shares this opinion with me.
Probably the quickest way to get a PHP server up and running on Windows is WAMP 2.0. Wamp Site. I use it on my Vista machine. Download it, run the 'exe', and start coding. It is only 16 MB but it is powerful and very simple to use.
Why not go the official Microsoft route:
Microsoft Web Platform Installer 2.0
installs both PHP (to run in IIS) and MySQL.
My two cents. I use Netbeans for my windows PHP development. Here is a quick start guide
As previously mentioned, XAMPP is probably the easiest and fastest way to get started with PHP. Search installing xampp on youtube, they got a good video on how to install it to your system.

PHP website, should I develop into a Linux distribution instead of Windows?

In few months I start a project in PHP and I am hesitating to do like usual : develop on my Windows Vista 64bits machine. Since I know few things on Linux, I think it can be a good way to learn by working on a Linux distribution.
Do you think it's a good idea or not? I would run a VirtualBox with Ubuntu (on my Vista64bits). I was thinking to install XAMPP to be able to develop in PHP.
If you think it's a good idea, feel free to suggest me some tutorial about what I should know with Virtualizing an OS, or Linux/dev.
Update
I have build many website in PHP with Windows, the question is more about if it's a good way to start learning Linux by developing on it via a Virtual machine? I have 4 gigs rams, will it be smooth if I install Eclipse in the Virtual Machine? etc.
You should really develop on the same platform where you are going to deploy. I'm not saying it is bad to do differently, but it can save you some pain in the long run. OTOH, you might learn faster about platform differences that way. So, the main question is: do you want to have a production system running ASAP without much headache? Or, you want to spend some time and make some effort to learn how to develop cross-platform stuff?
And yes, there are differences. For example, case sensitive and case in-sensitive filenames. Then, some PHP functions use native C functions that have different implementation. For example, printf() does not produce the same amount of whitespace for some of the types. Resolution of time measurement (milliseconds vs microseconds) can be different, etc. Then, you have different ways filesystem permissions are handled. These are just some recent problems I've found that I can remember off the top of my head.
PHP should be the same on any platform - so where you develop shouldn't matter.
However, in my experience and observation,more sites running PHP are running on Linux than Windows.
Getting Apache and PHP setup on something like Ubuntu or Fedora is a cinch, and testing everything is pretty simple, too.
Also, when you go live with your site, what platform will it be running on? I prefer to do development on the platform it will be running on whenever possible.
Personally, I don't think that for local production you should be using a VM. Would you be running your IDE inside the VM too?
If you are aware enough of the pitfalls of moving between Windows and Linux environments (such as case sensitivity and permissions), you should have no problem developing on Windows and deploying on Linux.
Working on a Linux distribution is defnitely the easiest way to learn it. And setting up some servers and doing some dev work is an excellent start.
Virtualising Linux is also really easy. I've done it quite a few times and it's really obious. Also, going this way will ease you into using Linux, much better than just jumping in and finding out your wireless card is unsupported like I did :)
As for PHP development on Linux... I've done some PHP coding on Windows and on Linux and I can tell you there's very little difference between the two. I use Eclipse on both platforms and Apache &MySQL / XAMPP. The only major difference I've seen is that Linux is much more finicky about permissions and case.
PHP is not the same on all platforms, and until very recently the windows versions had problems which were not found in the Linux versions. Lots of useful features are *nix specific.
I would echo #Milan's sentiments about developing in the deployment environment. You learn a lot more about the deployment environment by doing so too.
On the VM issue, if you want all your Windows tools and your windows machine, setup a linux server in your VM (can have a GUI if you want, but you're going to mainly use it as a server). Set it up so that windows can view the apache install running in your VM and you use samba shares to access the vm's files like a drive in windows. That way, you develop in windows but are testing deploy / setup on a running linux server. While two devs at my shop run Ubuntu, a third needs to use Photoshop and various other bits of windows software all the time, so she uses this method of running a server in a VM but developing from windows.
Oh, and if you're running on Linux, don't use XAMPP! A few simple commands will have you up and running and you'll get a much better understanding of your deploy. XAMPP is fine, but it's for OS's that don't have Linux's package management.
while XAMPP works great, running Apache and PHP on Linux is a given; while on Windows it's something extra you have to do... and support. Also, most parts of the stack are far more optimised and mature for a POSIX environment. The database engine(s) performance is particularly sensitive to the available primitives.
Most OSS runs on windows, but it's a round peg whammed on a square hole.
On principle, I would advise against "learning by doing" in a real project - unless it it really small, or you have doen very similar projects before, so that the learning curve on project related issues would not be steep. In that case you may have ressources free for learning about the developing environment.
Generally I like the Linux environment better than Windows. Mainly because all the CLI tools you would need are provided and Bash beats cmd.ext any time. But with Cygwin I find even Windows a comfortable development environment.
Regarding PHP development I can't really see how it would be much different. Maybe there is some benefit in being forced to make the code more portable (things like line endings, forward slashes in filenames and such) if you use booth systems.
As a desktop or workstation there isn't much difference between the two. I find that the biggest differences lies in how you administer them, but hopefullt you have some other people doing that for you.
In my opinion you needn't to develop in a linux distribution.
Web Development can be done from any OS. I don't know, why you are programming for the web... as a professional? for your personal homepage?
I think, it's enough to get some free webspace running a PHP Server and to upload your files there... it doesn't take you much time and there are less things to manage.
a german student ;)
Use the OS your deployment server will be running, and it is highly probable to be linux. I have recently seen a deployment gone ultra bad cuz it was developed using wampserver and deployed on CentOS. With major differences in apache and PHP config. So know your deployment server and match it as closely as possible.
Try creating a development environment using VmWare Player. I have several Linux environments that I run on my Vista laptop. You could also just dual boot. I use Ubuntu, it is easy.
The side effect of developing inside a VM: more overhead and eventually the needs of additional tools to make the development more comfortable.
Often people need special tools for their development like Photoshop or some vector design tools not available on Linux. If the working copy of the project is inside the VM, it makes sense to have easy access to it. So you will setup SAMBA (which makes often problems with the login from XP) or setup SSL(SFTP)/FTP.
Also you must learn how to use networking with the VM (NAT, bridging, port forwarding).
On the other side, developing on another platform as the target can give some headache. I found myself often confused with .htaccess files for password protection, because oft the different path on Windows/Linux. If you forget to change this entries later on the production server, you have a problem...
A better solution: use the best of both worlds.
A VM eventually running later headless (no gui, more like a "remote server") with Ubuntu/Debian/FreeBSD) and only running the needed servers (Apache, MySQL, FTP, SSH...).
Eclipse or the other development tools on Windows/Mac.
5 years later: My opinion is to use the Linux solution. There are many advantages for using PHP in Linux. The primary reason is the level of help available from the community. PHP seems to be optimized for Linux environments as well.
There is also safety in numbers as an overwhelming number of sites are hosted and run with LAMP solutions. There are a wide range of frameworks and CMS' that run best on Linux with Apache2.
Make your life easier and start learning PHP straight away.

Categories