Upgraded the dev environment to PHP 7.

This commit is contained in:
Peter Deltchev 2015-12-20 10:30:51 -08:00
parent e6c31a1500
commit f3f478cca4
8 changed files with 108 additions and 2203 deletions

4
Vagrantfile vendored
View file

@ -3,8 +3,8 @@ Vagrant.configure("2") do |config|
config.hostmanager.enabled = true config.hostmanager.enabled = true
config.hostmanager.manage_host = true config.hostmanager.manage_host = true
config.vm.box = 'laravel/homestead' config.vm.box = 'laravel/homestead-7'
config.vm.box_version = '0.3.0' config.vm.box_version = '0.2.0'
config.vm.provider "virtualbox" do |v| config.vm.provider "virtualbox" do |v|
v.cpus = 4 v.cpus = 4
v.memory = 2048 v.memory = 2048

View file

@ -29,24 +29,20 @@ class CreateLatestColumn extends Migration
}); });
DB::update(' DB::update('
UPDATE UPDATE tracks t1
tracks INNER JOIN (
SET SELECT id, user_id
is_latest = true FROM tracks
WHERE WHERE published_at IS NOT NULL
( AND deleted_at IS NULL
SELECT ORDER BY created_at DESC
t2.id LIMIT 1
FROM ) t2
(SELECT id, user_id FROM tracks WHERE published_at IS NOT NULL AND deleted_at IS NULL) AS t2 ON t2.id = t1.id
WHERE SET is_latest = true
t2.user_id = tracks.user_id WHERE t2.user_id = t1.user_id
ORDER BY AND published_at IS NOT NULL
created_at DESC ');
LIMIT 1
) = tracks.id
AND
published_at IS NOT NULL');
} }
public function down() public function down()

View file

@ -1,16 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf
sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm
sudo cp /vagrant/vagrant/php.ini /etc/php5/fpm/php.ini sudo cp /vagrant/vagrant/php-overrides.ini /etc/php/7.0/fpm/99-overrides.ini
sudo cp /vagrant/vagrant/pony.fm.mysql.config /etc/mysql/my.cnf
sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf
sudo service nginx restart sudo service nginx restart
sudo service php5-fpm restart sudo service php7.0-fpm restart
sudo service mysql restart
# todo: figure out how to restart redis # todo: figure out how to restart redis

View file

@ -0,0 +1,5 @@
[PHP]
expose_php = Off
post_max_size = 250M
upload_max_filesize = 200M

File diff suppressed because it is too large Load diff

View file

@ -1,127 +0,0 @@
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /vagrant/storage/logs/system/mysql-error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

View file

@ -1,85 +1,85 @@
user vagrant; user vagrant;
worker_processes 4; worker_processes auto;
pid /run/nginx.pid; pid /run/nginx.pid;
events { events {
worker_connections 768; worker_connections 768;
# multi_accept on; # multi_accept on;
} }
http { http {
## ##
# Basic Settings # Basic Settings
## ##
sendfile on; sendfile on;
tcp_nopush on; tcp_nopush on;
tcp_nodelay on; tcp_nodelay on;
keepalive_timeout 65; keepalive_timeout 65;
types_hash_max_size 2048; types_hash_max_size 2048;
# server_tokens off; # server_tokens off;
server_names_hash_bucket_size 64; server_names_hash_bucket_size 64;
# server_name_in_redirect off; # server_name_in_redirect off;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
## ##
# SSL Settings # SSL Settings
## ##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
## ##
# Logging Settings # Logging Settings
## ##
access_log /var/log/nginx/access.log; access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log; error_log /var/log/nginx/error.log;
## ##
# Gzip Settings # Gzip Settings
## ##
gzip on; gzip on;
gzip_disable "msie6"; gzip_disable "msie6";
# gzip_vary on; # gzip_vary on;
# gzip_proxied any; # gzip_proxied any;
# gzip_comp_level 6; # gzip_comp_level 6;
# gzip_buffers 16 8k; # gzip_buffers 16 8k;
# gzip_http_version 1.1; # gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
## ##
# Virtual Host Configs # Virtual Host Configs
## ##
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*; include /etc/nginx/sites-enabled/*;
} }
#mail { #mail {
# # See sample authentication script at: # # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# #
# # auth_http localhost/auth.php; # # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER"; # # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS"; # # imap_capabilities "IMAP4rev1" "UIDPLUS";
# #
# server { # server {
# listen localhost:110; # listen localhost:110;
# protocol pop3; # protocol pop3;
# proxy on; # proxy on;
# } # }
# #
# server { # server {
# listen localhost:143; # listen localhost:143;
# protocol imap; # protocol imap;
# proxy on; # proxy on;
# } # }
#} #}

View file

@ -1,52 +1,39 @@
server { server {
listen 80; listen 80 default_server;
client_max_body_size 200M; server_name ponyfm-dev.poni api.ponyfm-dev.poni;
gzip on; access_log /vagrant/storage/logs/system/nginx-access.log;
gzip_comp_level 4; error_log /vagrant/storage/logs/system/nginx-error.log;
gzip_min_length 1280; root /vagrant/public;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp application/json;
gzip_vary on;
server_name ponyfm-dev.poni api.ponyfm-dev.poni; client_max_body_size 220M;
access_log /vagrant/storage/logs/system/nginx-access.log;
error_log /vagrant/storage/logs/system/nginx-error.log;
root /vagrant/public;
location / { location / {
index index.html index.php; index index.php;
location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
add_header "Access-Control-Allow-Origin" "*";
}
if (!-e $request_filename) { try_files $uri $uri/ /index.php$is_args$args;
rewrite ^/(.*)$ /index.php?/$1 last; }
break;
}
}
location /dev-styles/ { location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
alias /vagrant/app/styles/; add_header "Access-Control-Allow-Origin" "*";
} }
location /dev-scripts/ { expires off;
alias /vagrant/app/scripts/;
}
location ~ \.php$ { location /vagrant-files {
fastcgi_split_path_info ^(.+\.php)(/.+)$; internal;
fastcgi_pass unix:/var/run/php5-fpm.sock; alias /vagrant-files/;
fastcgi_index index.php; }
include fastcgi_params;
}
expires off; location ~* \.php$ {
try_files $uri = 404;
error_page 404 /index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$;
error_page 403 /403.html; fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
location /vagrant-files { include fastcgi_params;
internal; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
alias /vagrant-files/; fastcgi_param SCRIPT_NAME $fastcgi_script_name;
} }
} }