星期四, 3月 28, 2019

PHP7

Nginx

The following NEW packages will be installed: 1,346 kB
  nginx nginx-common nginx-core
Suggested packages:
  fcgiwrap nginx-doc



/etc/nginx/nginx.conf



service nginx restart

restart service:
sudo systemctl restart php7.0-fpm nginx
debug: 
  • systemctl status nginx.service
  • journalctl -xe

/etc/nginx/sites-available/example.com
--------------------
server {
    listen 80;
    listen [::]:80;

    server_name example.com;

    root   /var/www/html/example.com/public_html;
    index  index.html index.php;

    location / {
        try_files $uri $uri/ =404;
    }
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            include fastcgi_params;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            fastcgi_param SCRIPT_FILENAME /var/www/html/example.com/public_html$fastcgi_script_name;
    }
}


--------------------
https://www.linode.com/docs/web-servers/nginx/install-and-configure-nginx-and-php-fastcgi-on-ubuntu-16-04/


PHP7

 config file


  • 13.2 MB
  • /etc/php/7.0/fpm/php.ini
  • /etc/php/7.0/cli/php.ini
  • /etc/php/7.0/mods-available/
  • /usr/bin/php
  • /usr/bin/phar
  • /usr/bin/phar.phar

dependency





The following additional packages will be installed:
  php-common php7.0 php7.0-cli php7.0-common php7.0-fpm php7.0-json php7.0-opcache php7.0-readline

<form class="form-horizontal" action="送至.php" method="post" role="form">
表單元件
</form>

表單中加入「表單欄位」:
<form class="form-horizontal" action="index.php" method="post" role="form">
  <div class="form-group">
    <label class="col-md-4 control-label" for="name">帳號:</label>
    <div class="col-md-8">
      <input type="text" name="name" id="name" placeholder="請輸入帳號" class="form-control">
    </div>
  </div>
  <div class="form-group">
    <label class="col-md-4 control-label" for="passwd">密碼:</label>
    <div class="col-md-8">
      <input type="password" name="passwd" id="passwd" placeholder="請輸入密碼" class="form-control">
    </div>
  </div>
  <div class="text-center">
    <input type="hidden" name="op" value="login">
    <button type="submit" name="button" class="btn btn-primary">登入</button>
  </div>
</form>













沒有留言: