User Tools

Site Tools


nginx_php

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nginx_php [2023/01/28 20:46] – [Configuration Files] adminnginx_php [2023/01/28 21:10] (current) – [Finish] admin
Line 55: Line 55:
  
 WARNING if you are tempted  to simply copy/paste the configuration data rather than copy the entire code block, don't unless you understand here documents and escaping special characters.   WARNING if you are tempted  to simply copy/paste the configuration data rather than copy the entire code block, don't unless you understand here documents and escaping special characters.  
- 
-If you don't/can't write to the pool.d file, change the file name to something else like /tmp/sample and let the cat command write the file.  To do that change the first line of this script to  cat >/tmp/sample.conf <<EOF 
  
 Otherwise you'll have problems you don't want to have to fix.  Same goes for the nginx config file. Otherwise you'll have problems you don't want to have to fix.  Same goes for the nginx config file.
  
-Copy this block and paste it directly into your shell.+If you don't/can't write to the pool.d file, change the file name to something else like /tmp/sample and let the cat command write the file.  To do that change the first line of this script to  'cat >/tmp/sample.conf <<EOF' then figure out how to get that data into the /etc/php/${PHP_VER}/fpm/pool.d/${DOMAIN}.conf file.  This is the way you would do it if you are attempting to run these instructions as a normal user. 
 + 
 +Highlight and copy this block and paste it directly into your shell.
 <code> <code>
 cat >/etc/php/${PHP_VER}/fpm/pool.d/${DOMAIN}.conf <<EOF cat >/etc/php/${PHP_VER}/fpm/pool.d/${DOMAIN}.conf <<EOF
Line 98: Line 98:
  
 Here's my nginx config.  Adjust as you need: Here's my nginx config.  Adjust as you need:
 +Highlight and copy this block and paste it directly into your shell.
 <code> <code>
 cat >/etc/nginx/sites-available/${DOMAIN}.conf  <<EOF cat >/etc/nginx/sites-available/${DOMAIN}.conf  <<EOF
Line 164: Line 165:
 service nginx restart && service php${PHP_VER}-fpm restart service nginx restart && service php${PHP_VER}-fpm restart
 </code> </code>
 +
 +Test with these commands:
 +<code>
 +cd /home/${DOMAIN}/www
 +cat >phpinfo.php <<EOF
 +<?php
 +phpinfo( );
 +?>
 +EOF
 +</code>
 +Now bring up a browser and go to http://YOUR_DOMAIN/phpinfo.php.
 +
 +Where YOUR_DOMAIN is the value you set into ${DOMAIN} earlier.
 +
 This is somewhat tested.  This is somewhat tested. 
  
nginx_php.1674935170.txt.gz · Last modified: 2023/01/28 20:46 by admin