Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[TUT] How to install Nginx + php5 + mysql [TUT]

How to install Nginx with PHP5 and MySQL


Ummmm, I'm going to help you to install Nginx with MySQL and PHP and I will include how to setup PhpMyAdmin.
This will be tut on a Debian based distro so if you use CentOS or some other distro, the config part should be the same but other way to install the package. 😎

Install MySQL services Spoiler (Click to View)
Install NginxSpoiler (Click to View)

Install PHP5 and configure itSpoiler (Click to View)
install & starting spawn-fcgiSpoiler (Click to View)

Configure Nginx

Ok, this is the part I HATE.
We need to edit /etc/nginx/sites-available/default...
PHP Code

<?php 
nano 
/etc/nginx/sites-available/default 

and change from
Server {
listen 80;
CRAAP
}

to this :
Spoiler (Click to View)

Then restart Nginx and try the PHP out. Now, Nginx with PHP + MYSQL should be up...
PHP Code

<?php 
/etc/init.d/nginx restart 

Installing PhpMyAdmin
Lets install phpmyadmin first.
PHP Code

<?php 
apt
-get install phpmyadmin 

and then edit default again.
PHP Code

<?php 
nano 
/etc/nginx/sites-available/default 

and add this above "# deny access to .htaccess files, if Apache's document root"
Spoiler (Click to View)

Then restart nginx and test SERVERIP/phpmyadmin 🤗
PHP Code

<?php 
/etc/init.d/nginx restart 

And everything should be up and running. If not comment or PM me and I will try to help any way I can. ✌
nice tutorial it should be useful to someone.. the commands are pretty basic knowledge though.
Spoiler those codes mate, idk about you guys but they are running off the edge of my 42inch monitor and I know thats going to be hell for some of you guys running 12inches.
(Jul 2, 2012 08:56 AM)Your mum Wrote:  Spoiler those codes mate, idk about you guys but they are running off the edge of my 42inch monitor and I know thats going to be hell for some of you guys running 12inches.

For me its fine when i have full screen on. But for people with smaller screens its going to run off like crazy. But thanks for the guide anyways never used nginx before.
Dev . Design . Deploy
Always looking for a new project! PM me!

added spoilers :-)
Should be better for those who have small screens. mine is 1920x1080 so it was fine for me :D
Was Experimenting with Nginx today for the first time in awhile looking too make a compleate switch from apache2 too nginx but im having some problems.

Phpinfo.php displays fine..

But i have uploaded some other php files and they all show white page no error/404 just white...

What could be the issue?

Regards
(Nov 2, 2012 04:09 AM)SEANoEv0l Wrote:  Was Experimenting with Nginx today for the first time in awhile looking too make a compleate switch from apache2 too nginx but im having some problems.

Phpinfo.php displays fine..

But i have uploaded some other php files and they all show white page no error/404 just white...

What could be the issue?

Regards

nginx sucks dick for dynamic content (especially php). just stick with apache22
Don't gravedig old threads. And just flame what other people have said.
(Nov 2, 2012 04:09 AM)SEANoEv0l Wrote:  Was Experimenting with Nginx today for the first time in awhile looking too make a compleate switch from apache2 too nginx but im having some problems.

Phpinfo.php displays fine..

But i have uploaded some other php files and they all show white page no error/404 just white...

What could be the issue?

Regards

Do you upload it on other directory's? Ie /var/www/(nginx-default ?)/thisismydirectory/yourphppage.php


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Debian] by jasonnixJun 2, 2024 03:33 AM 0 127 Jun 2, 2024 03:33 AM
Last Post: jasonnix
[CentOS] by h3x0neNov 3, 2020 11:28 PM 5 151 Nov 3, 2020 11:28 PM
Last Post: Angela White
by Not Your Average OrangeOct 14, 2017 09:57 PM 25 674 Oct 14, 2017 09:57 PM
Last Post: Not Your Average Orange