發表文章

目前顯示的是 2月, 2018的文章

[PHP] install php7 on mac

$ curl -s http://php-osx.liip.ch/install.sh | bash -s 7.2 $ export PATH=/usr/local/php5/bin:$PATH $ php -v $ sudo vi ~/.bash_profile 把 export PATH=/usr/local/php5/bin:$PATH 寫在裡面 之後開啟就都會是PHP7了 如果覺得php7.2在mac上跑的很慢 sudo vi /usr/local/php5/php.d/50-extension-imap.ini 把裡面的東西註解掉就會正常 使用composer創laravel專案 composer create-project --prefer-dist laravel/laravel 專案名稱

[css] 讓anchor可以在fix header底下

.anchor {          display : block ;          height : 75px ; /*same height as header*/          margin-top : -75px ; /*same height as header*/          visibility : hidden ;     } < span class = "anchor" id = " <?= $val ? > " ></ span > < h2 class = 'title30 grey mb10' > <?= $vkey ? > </ h2 > < p class = 'Mtitle grey mb5' > ... </ p > < p class = 'small red mb0' > ... </ p > 利用height等於navbar header的高度 然後再用margin-top等於負的navbar header的高度 然後在h2前面放一個span.anchor 就可以在網頁版看不出來, 手機版的anchor卻可以正確地在header底下出現

php related settings (thinkphp)

Ref:  http://yenpai.idis.com.tw/archives/360-%E6%95%99%E5%AD%B8-%E5%9C%A8-centos-%E4%B8%AD%E5%AE%89%E8%A3%9D-php-fpm-for-nginx php5.6 fpm config: /etc/php/5.6/fpm/pool.d/www.conf listen = 127.0.0.1:9999 listen.allowed_clients = 127.0.0.1 user = www-data group = www-data pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 35 slowlog = /var/log/php-fpm/www-slow.log php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on 改完之後要重啟php5.6-fpm /etc/init.d/php5.6-fpm restart service php5.6-fpm restart php5.6-fpm的log /var/log/php5.6-fpm.log 當php5.6-fpm stop 跑出 unknown instance時 可以透過以下來找出開啟的php5.6-fpm process ps aux | grep php 然後把找到的pid給kill掉 nginx config server { listen 80; server_name cari-test.com; root /home/neil/cari_test/public; index index.php index.html; location / { if (!-e $request_filename) {

mac上安裝composer

Ref:  https://devforgalaxy.github.io/zh/2016/05/06/install-composer-on-mac-zh.html $ php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php $ php composer-setup.php $ php -r "unlink('composer-setup.php');" $ mv composer.phar /usr/local/bin/composer

在CentOS上安裝GraphicsMagick

Ref:  https://gist.github.com/paul91/9008409 #!/bin/bash # Install build dependencies yum install -y gcc libpng libjpeg libpng-devel libjpeg-devel ghostscript libtiff libtiff-devel freetype freetype-devel # Get GraphicsMagick source wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.9.tar.gz tar zxvf GraphicsMagick-1.3.9.tar.gz # Configure and compile cd GraphicsMagick-1.3.9 ./configure --enable-shared make make install # Ensure everything was installed correctly gm version # If you are going to use this with PHP you can also instal the pecl extension pecl install gmagick-1.0.8b2

[AWS] 將S3檔案的網址綁定多個 domain

圖片
From :  https://stackoverflow.com/questions/6130985/map-multiple-subdomains-to-same-s3-bucket/6141297#6141297 1. 先將 S3 Bucket 開啟 Static Website Hosting 2. 去 CloudFront 建立 Distributuin 在同一頁底下, CNAMEs的欄位填上自己需要換的 domain 如果需要多個可以用換行的方式填入多個, 支援wildcard 剩下的就是在自己的DNS上將需要的domains對應到cloudfront的domain上