Activar Driver PDO con XAMPP o servidores APACHE
1. Verificar las extensiones de PDO activadas
php -i|grep PDO
2. Descomentar las librerias pdo para el driver que se va utilizar(MYSQL, PGSQL, ec) del archivo PHP.INI
sudo nano /opt/lampp/etc/php.ini
si no utilizas xampp utliza la ruta de tu php.ini
utilizando GEDIT
sudo gedit /opt/lampp/etc/php.ini
# mysql
extension=php_pdo_mysql.dll
# Posgress
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
algo asi
3. instalar el driver
-activar para postgress
sudo apt-get install php7.0-pgsql
-activar para mysql
sudo apt-get install php7.0-mysql
Mostrando las entradas con la etiqueta Php7. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Php7. Mostrar todas las entradas
martes, 4 de abril de 2017
martes, 27 de diciembre de 2016
Host Virtual NgInx and PHP 7
Editar
sudo nano /etc/nginx/sites-enabled/defaultEn file default...
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.php index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# ======= COMANDO
# crear una copia al sitio default
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/apierplife.dev
#colocarlo en sitios enabled
sudo ln -s /etc/nginx/sites-available/apierplife.dev /etc/nginx/sites-enabled/apierplife.dev
# ======= CONFIGURACION DEL VIRTUAL HOST
# Default server configuration
#@armandoaepp
server {
listen 80 ;
listen [::]:80 ;
root /var/www/html/erplife/apierplife/public;
# Add index.php to the list if you are using PHP
index index.html index.php index.htm index.nginx-debian.html;
server_name apierplife.dev;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
=============================
#AGREGARLO HOSTS(sudo nano /etc/hosts)
127.0.0.1 apierplife.dev
REINICIAR SERVE
sudo systemctl restart nginx
=======MAS EJEMPLOS ==========================
crear un nuevo host virtual, por ejemplo tudominio.com(cofemicsa.dev)
# Default server configuration
#
server {
listen 80 ;
listen [::]:80 ;
root /var/www/html/cofemicsa/sistcofemicsa/;
# Add index.php to the list if you are using PHP
index index.html index.php index.htm index.nginx-debian.html;
server_name cofemicsa.dev;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
For LARAVEL 5.3
crear un nuevo host virtual, por ejemplo tudominio.com(apicofemicsa.dev)
crear un nuevo host virtual, por ejemplo tudominio.com(apicofemicsa.dev)
# Default server configuration
#@armandoaepp
server {
listen 80 ;
listen [::]:80 ;
root /var/www/html/cofemicsa/apicofemicsa/public;
# Add index.php to the list if you are using PHP
index index.html index.php index.htm index.nginx-debian.html;
server_name apicofemicsa.dev;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
REFERENCIAS
By Power : @armandoaepp and @tobal2010
Suscribirse a:
Entradas (Atom)

