How to set up PHP on a Server?

I just got a VPS to host my client’s website. It includes WHM, cPanel and LAMP.

Have just spent the last few days learning the basics of WHM and cPanel and thought I was ready to go, when it occurred to me that I probably have to set things up with PHP!

Locally I have been working with MAMP, and so most everything I needed was configured out of the box.

What kinds of things will I need to do with PHP to not only make it ready for my code, but also safe and secure?

About 4 years ago when I first started learning PHP, I vaguely remember poking around some .ini file and some other things per a book I was reading at the time. But even if I remembered what the book told me to do - which I don’t - I have no clue what to do on a LAMP VPS that is ready for prime time!! :hushed:

Some help and suggestions from anyone running a production environment would be appreciated!!

Thanks.

The P in LAMP means PHP. So PHP should be included on the server. You shouldn’t need to worry about security of ini settings for PHP on the providers servers. That is the responsibility of your service provider. Though those settings might need to be tuned and what not depending on your application or if the provider will even allow you to do so.

There is a Tweek settings link on the WHM panel you can use to adjust email etc. At the bottom of the navigation on the left there is a security check where you can get an idea of your security with suggestions on what to fix. If it is installed as a plugin - ConfigServer Security & Firewall - Check Server Security.

You can update php and add apache modules with easyApache again it is a link on the left.

Expect to get quite a few emails from the server concerning security!

And as I said, it is.

I wouldn’t go that far.

It is not the webhost’s provider to secure my server…

I recall reading a whole bunch of things you should tweak in your php.ini file, but I no longer have that book, and thus the reason for this thread…

Huh? Unless you are managing your own server, it most certainly is their job. It’s in their own best interest to do so.

It’s your job to secure any code you’re using.

I don’t have “Tweak”

I don’t see any of that either.

What about things in the php.ini file?

I could try and look at my Dev php.ini file and maybe I have some notes, but it just seems like there should be a clearly defined list of “.ini Settings Your Should No Use Defaults On!!”

Many providers of shared servers don’t allow modification of their ini settings. It is highly unlikely those settings can be changed on a shared server without talking to the service provider themselves. That is unless they have some type of GUI you can access to change the settings but direct access to the ini settings and installing new extensions unlikely. What would prevent you from changing the settings or introducing unsecure code onto server than absolutely nothing. Unless you’re using a dedicated hosting environment or aws or something most basic providers don’t allow changing those settings easily partially for the exact reason you’re talking about – security.

Why do you assume I am on Shared Hosting???

This is the first line of the OP’s original post.

Your Web Hosting Provider’s reputation is at stake if their basic security settings are faulty. Just trust them and get your site online :slight_smile:

Edit:
Just stumbled upon this link which may be useful:
Web Application Security for dummies
http://whitepapershg.tradepub.com/free/w_qa69/prgm.cgi

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.