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.manage_host = true
config.vm.box = 'laravel/homestead'
config.vm.box_version = '0.3.0'
config.vm.box = 'laravel/homestead-7'
config.vm.box_version = '0.2.0'
config.vm.provider "virtualbox" do |v|
v.cpus = 4
v.memory = 2048

View file

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

View file

@ -1,16 +1,13 @@
#!/usr/bin/env bash
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/php.ini /etc/php5/fpm/php.ini
sudo cp /vagrant/vagrant/pony.fm.mysql.config /etc/mysql/my.cnf
sudo cp /vagrant/vagrant/php-overrides.ini /etc/php/7.0/fpm/99-overrides.ini
sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf
sudo service nginx restart
sudo service php5-fpm restart
sudo service mysql restart
sudo service php7.0-fpm restart
# 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,5 +1,5 @@
user vagrant;
worker_processes 4;
worker_processes auto;
pid /run/nginx.pid;
events {

View file

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