Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

I'm installing PHP on a server. What do I need?

Anytime that I've installed PHP, it's always been on my box. If I was using an ISP, they always had it in place as an option I simply chose. So, now I'm being asked by a co-worker who's setting up PHP on a Linux server "What do you need?"

I'm assuming the answer would be to simply download LAMP, just like you would WAMP (http://www.wampserver.com/en/), but there's the issue: I don't see that kind of option with LAMP.

So, my administrator sent me this email, asking if I needed anything else. Not sure what to tell him and was hoping someone with a mind greater than my own could look this over and tell me whether or not anything else is needed.

Thanks!

Going to install:
                crontabs              - http://www.crontabs.org/                                                                       - scheduled tasks
                redhat-lsb           - http://www.linuxfoundation.org/collaborate/workgroups/lsb- linux standardization
                sysstat                  - http://www.systat.com/                                                                           - ? charts
                webalizer            - http://www.webalizer.org/                                                                     - web server log file analysis
                php-ldap              - http://php.net/manual/en/book.ldap.php                                       - ldap for php
                php-mysql          - http://php.net/manual/en/book.mysql.php                                    - MySQL for php
                php-mbstring    - http://php.net/manual/en/book.mbstring.php                              - multibyte strings for php
Avatar of Gary
Gary
Flag of Ireland image

Unless you have specific requirements in PHP then the default install is fine.
Avatar of Bruce Gust

ASKER

Hey, Gary! That's what he has listed above, correct?
I don't see any mention in the list of LAMP but the default LAMP config should be fine for the install then you need to secure it (the default setup is not secure)
Also no mention of a firewall
Avatar of Brandon Lyon
Brandon Lyon

I'm not really sure what is being asked for. If you need PHP then the answer is install PHP.  What is the end goal?

Are you trying to run a website? Do you need phpmyadmin as well as a database? Are you just trying to get a PHP script running which requires a certain version of PHP? Do you need any specific plugins or frameworks?

LAMP usually stands for Linux, Apache, MySQL, PHP. WAMP stands for the same thing but with Windows instead of Linux. Those could be configured and running with virtually any combination of plugins and settings.
If at all possible, you should be using the packages created by the Linux distribution that you are using.  I think all of the things on your list are either normally available or available thru  the 'repositories' for that version of Linux.  If they are not available, the normal method for installation on Linux is to download the source code, compile it and install it yourself.  I do not recommend that you do that.  The distributions of Linux vary a lot more than the versions of Windows.
Is there any reason you are using RHEL and not Centos?
My setup with Centos would be install ISPConfig and you are done.
I'm not doing the install. It's a guy that's working remotely, so I'm able to look over his shoulder and see what he's doing. In the past, anything that I've had to install was a slam dunk just by grabbing a package like what Dave suggests. To things broken up into specific elements and then being asked if "Do I have everything?" is outside my comfort zone.

Is there an equivalent to WAMP for Linux servers? What's the "package" for LAMP scenarios? Or what do I need to tell this person? Is the fact that he's got "pieces" listed indicative of a flawed approach?

Bottom line: I've got a couple of administrators who are .NET guys who need to install PHP and MySQL on a Linux server. The "reports" that I'm getting back are "MySQL's not working" and other comments that suggest there's a simple approach that they're blowing right past and I don't know what to tell them.

What do you think?
Gary, go with me here, 'cause I'm an ignorant rabbit...

I'm assuming this is what you're referring to: http://www.centos.org/. What do I need to tell my guy?
I don't think you are understanding the 'package' concept on Linux.  Each distribution and in particular, each major distribution, has it's own way of arranging the file system on Linux.  Ubuntu and Redhat/CentOS do not do things exactly the same way.  Each though has it's own way of installing it's Own packages from it's Own repositories where their Own versions of programs are stored.

What version of Linux are you working with?  If you can't answer that question, you should step away from the computer and hire someone who can.  Second, MySQL doesn't come up running 'right out of the box'.  You have to install databases, create users, and possibly enable remote access.  That's true on Windows too except when you have WAMP or XAMPP which both come with phpMyAdmin.
First question is why are you using RHEL?

Centos is the "community version" of RHEL with no support.
I would go with Centos and install ISPConfig then you have a nice GUI for the server and it sets everything up for you
SOLUTION
Avatar of Brandon Lyon
Brandon Lyon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's a good post by @gr8gonzo.  Setting up a Linux server in my experience is not like installing WAMP or XAMPP on Windows.  While the package manager will install all the things you need (in their standard configuration), you will still have to go in and configure quite a few things.  It isn't going to just "come up and run".  Maybe the package Gary mentioned will do that but I haven't seen that on the 3 different distributions that I have used and installed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you have everything set up right and tighten down the server then you can pretty much forget about it apart from the occasional update and security fixes as they come along.


I've yet to have anyone hack my server and they try everyday.

edit
And make sure any clients are isolated. You can never account for stupidity.
One additional note on package managers and dependencies - part of the reason I don't use them for mission-critical things is that package managers tend to overdo the dependencies and end up linking everything together. So if you later need to remove a dependency library, it can sometimes try to remove other packages that are linked to it. More often than not, it wants to remove things that you don't want to remove, forcing you to try and piecemeal the removal process.

So my own recommendation is to only use package managers to install things that you know you are never going to want to remove later.

Example: When I was a Linux newbie, I used a package manager to install everything. This was back in PHP 4 days and when PHP 5 came out and got stable for several months, the repository still didn't have a PHP 5 package. Since I didn't want both PHP 4 and PHP 5 on the system, I wanted to remove PHP 4 from the package manager. However, the package manager wanted to remove Apache and MySQL, too. I forced the removal of just PHP 4 and later when I tried to update the Apache and MySQL packages, the package manager wanted to re-install PHP as a dependency.

I think that most package managers have improved since then, but I still see that in yum sometimes. I think apt is slightly better, but I don't run a lot of Ubuntu (or similar) servers.
Never had a problem with ISPConfig, it's not so dependant on what is installed even though it installs everything for you, well the basics, apache, mysql, bind, postfix, dovecot off the top of my head, you can switch to nginx, you can do php versioning per site.
Now if you removed MySQL, for some strange reason, you would feck the GUI up.
It's a pleasure to use, even though I still do a lot of CLI work.

Others like Virtualmin I think you have to do all updates within the GUI using their own modded versions - which is not nice

edit
I think it uses the EPEL repo so a safe way to update
And now Bruce is more confused than ever!
But great discussion - maybe should make it a real discussion.
Thanks, folks! It will take a while to digest everything but the bottom line is that:

WAMP and other similar services are not software packages in and of themselves, rather they are bundles of standalone apps / software

Linux offers a whole new world of opportunities and options when compared to its Windows counterpart

While you can take a similar approach with a Linux server, as far as using a service that bundles things together, taking the time to really understand what you're trying to do and then using a command line approach, is probably your best bet.

Does that sound right?
While that is an interesting viewpoint, it implies that you have a lot of time to learn about things.  I installed and use the 'desktop' version of Ubuntu and added the server features.  With the Gnome GUI, it is much easier to navigate thru things.  On the other hand, I'm pretty sure the production servers I use for hosting only use the command line.  But hosting companies have other tools to make it easier to configure and manage their servers.  They are not sitting there "at the command line" doing everything one by one on the thousands of server that some of them have.

One of the first things you should learn is that the 'easy' way is to use the packages provided by the distribution because they are configured to run with the other packages.  If you don't use the packages, then you are expected to download source code and compile it for your machine.  Then you have to know or find out where your distribution puts things in the file system.  No... they are not all the same.