Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have a wallpaper website (almost all traffic goes to images). I use the following apps to serve.
apache2 + php5.3 + CGI/FastCGI
I have recently read that Nginx is faster than Apache. Also, many people advise using php-fpm. Do you recommend me to move my website to
Nginx+php-fpm
or just make
apache2 + php-fpm?
There definitely is a difference in performance of Apache and NGINX.
Both have their strongsuits and their weaknesses but in general:
If PHP has to do a lot of work Apache will actually be faster because mod_php is a part of the Apache itself and is really good integrated.
The additional (f)cgi takes some time too when using Nginx and thus making it slower on PHP-heavy applications.
Conclusion
Do you only want to serve a lot of static data (like images) you are better of with NGINX, because if excells on static content.
--> In your case I'd go with NGINX...don't forget to make good use of NGINX' caching-mechanisms!
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Can I use php7.4-fpm with Apache? Or is php-fpm really only for use with nginx? And why?
Does php7.4 support http2? Or do you still need php-fpm? The official http2 site (http2.pro) hasn't been updated in a couple of years.
Is it Still worth activating HTTP2? (The latest update dates back to a couple of years ago.)
To activate http2 I followed all the procedure described here: https://http2.pro/doc/Apache, now if I have to reactivate php (normal) how do I go back?
(The question was initially much more explanatory, but the administrators didn't like it ... they ask for it to be more focused, so let's try with only the questions.)
PHP-fpm is a version PHP that talks to the outside world with a protocol (a style of communication) called FastCGI. Apache can also talk via fastcgi to the servers it uses to answer requests - in both Nginx & Apache via the php-fpm: master process, that organises the pool of workers that actually run the PHP code. Since Nginx doesn't have mod_php, the only significant way to have it run PHP code is with php-fpm (there are some other methods, but they are not so often used)
HTTP2 is something for the webserver to deal with - Apache, or NginX. PHP doesn't need to worry about it, unless you want to send additional headers that the webserver would then deal with on its behalf (like also sending CSS or .JS files along with the initial connection - this is called HTTP-push, but it's not yet well widely established).
HTTP2 it totally worth it - you will, however, use this alongside the older http v1.0, or v1.1, but it is more efficient for browsers that support it.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I would like to install a web server with a database on a Raspberry Pi (little computer).
The computer has only 1GB RAM.
I want to know what is the best combination: Linux distribution and web server and DBMS to run the local server with multiple users with minimal latency, I will use PHP on the server. And what are the best settings for good performance and to not have bugs (memory usage, disable plugin, disable service, etc)?
I thought a light Debian , a lighttpd server and SQLite for the database. Is this is a good solution?
I think Lighttpd + SQLite is a great choice. For the linux distro, Debian is good but you could also look at CentOS or something like Tiny Core Linux, although I'm not sure of the compatibility with the Pi. Obviously, you can't go wrong with Raspbian
If you want to use this in production and get more stable performance, you could get a few more Pi's and set them up in a cluster.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
From what I understand, Apache (or Nginx) has been the server of choice (as well as it being installed as part of LAMP/WAMP/MAMP packages). However, the current installation instructions for Symfony (2.6) recommend using the built-in PHP webserver.
From what I understand, this has been in active development since php 5.4 and is making continual improvements. Could someone help give some perspective on this switch from Apache->PHP webserver?
Is to due comparable speed/efficiency/security
Is it more to do with simplifying the Symfony setup (and therefore
only really to be used for development servers)?
read the warning in documentation:
http://php.net/manual/en/features.commandline.webserver.php
It is not intended to be a full-featured web server.
they don't intend to make the tool a webserver.
I recommend nginx with php-fpm
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am classic asp developer, now shifting to PHP, MySQL development. I am using windows OS for my development. I don't want shift on Linux ( this is personal choice , I don't want to get in debate of windows vs Linux ) .
I tried to install php and other stuff on IIS , I am slowly turning towards frameworks like Laravel.
So, is it good to use php under IIS than apache , what difference will it make if I dont use apache ..
EDIT
i just want know, will some feature will disabled under iis, and what will be difference for execution of php script under iis ,
There is no reason to use IIS with PHP. Apache is much easier to set up and much closer to any shared hosting environment you are likely to run your code on. I used to use IIS for my dev and it always drove me crazy.
I installed Apache on windows and I've never looked back.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to figure out what would be the most performing configuration to host a PHP website on Amazon EC2.
Which webserver? (Apache, Lighttpd, nginx)?
Which PHP module? mod_php, FastCgi?
Which OpCache? (xcache, APC, eAccelerator, Varnish)
What would you recommended setup would look like?
It depends on your application running on the server. Needs much more memory or cpu or both?
Nginx + PHP-FPM + Varnish-Cache is a good solution if you can use them effectively.