![]() You can now install some PHP extensions which you may find come in handy, as I’m using FuelPHP, the recommended PHP extensions are as follows:. Make sure you select FPM at the configuration screen, you can also de-select SUHOSIN if you wish, I only really feel this is worth having if your using PHP in a shared hosting environment this server however will be running a single web application with no other system users so I do not see the benefit of having this installed too. Now we’ll install the latest version of PHP 5.3, so now we run the following commands:- cd /usr/ports/lang/php53 We’ll move on now but we’ll be back soon to make some config changes to nginx but for now we’ll go and install some other packages. If you browse to your web server using a web browser you should now see the default nginx homepage. Once that has been installed we need to add it to the rc.conf and start the service like so: echo 'nginx_enable="YES"' > /etc/rc.conf Now you’ll see a blue ‘configuration’ screen appear, you can choose to leave the defaults if you wish or select additonal modules, I will be using an SSL certificate so I also checked HTTPS (SSL) support. Ok, so the basic install is rather easy, lets quickly run the following commands:- cd /usr/ports/www/nginx There we go, we now have Nano installed, if you prefer using the default editor (Vi) then thats fine and you can skip the above step! Installing nginx Ok so first up, I’m quickly going to install Nano, its my preferred editor of choice so I quickly run the following commands:- cd /usr/ports/editors/nano Or if you don’t currently have them installed, run the following command:- portsnap fetch extract update Install Nano The very first thing to do, is quickly update the server’s port tree you can do this like so: portsnap fetch update Or, by "optimization" you mean something else than opcode cache, like the configuration directive apc.optimization ? If so, this one has been removed in APC 3.0.The aim of this post is to document the installation of Nginx, MySQL, PHP, APC and Memcache specifically to work as a web application server for hosting a FuelPHP application.įirst of all I will assume that you have already installed the base OS, configured an IP address and logged into your server using the ‘root’ account, if you don’t want to use your ‘root’ account for this installation, make sure you add ‘sudo’ to the start of all the nessacery commands to gain the appropriate permissions to carry out the installations etc. (I don't know how it works exactly, but it's something like that, at least in the principles, even if my words are not very "technical" ^^ ) When PHP is run from CLI, there is nothing to keep the memory segment there, so it is destroyed at the end of PHP's execution. When running PHP as an Apache module, Apache is responsible for the persistence of that memory segment. read the opcodes from memory (much faster than compiling the source-code)īut this means you must have some place in memory to store the opcodes.What APC does is store in opcodes in memory, so the execution of a PHP script becomes : read the file, and compile it into opcodes.So opcode-cache in APC is useless in CLI mode : it will not optimize anything, as PHP will still have to re-compile the source to opcodes each time PHP's executable is launched.Īctually, APC doesn't "optimize" : the standard way of executing a PHP script is like this : Maybe APC will store the opcodes in memory, but as the PHP executable dies at the end of the script, that memory will be lost : it will not persist between executions of the script. The documentation of apc.enable_cli, which control whether APC should be activated in CLI mode, says (quoting) :
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |