分类 环境搭建 下的文章

centos8 安装php8

1.下载软件
   

 wget http://www.ijg.org/files/jpegsrc.v9d.tar.gz
 wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.gz?download
 wget http://mirrors.nju.edu.cn/gnu/libiconv/libiconv-1.16.tar.gz

2.安装 扩展库
    2.1 
    

 tar zxvf jpegsrc.v9d.tar.gz 
 cd jpeg-9d/
 ./configure --prefix=/usr/local/lib/jpeg --enable-shared --enable-static
 make
 make install
 cd ../

     2.2
    

 tar zxvf libpng-1.6.37.tar.gz 
 cd libpng-1.6.37
 ./configure --prefix=/usr/local/lib/libpng
 make
 make install
 cd ../

     2.1
     tar zxvf libiconv-1.16.tar.gz
     cd libiconv-1.16/
     ./configure --prefix=/usr/local/lib/libiconv
     make
     make install
     cd ../

     vi /etc/ld.so.conf.d/my.conf

    添加yihang:
    /usr/local/lib
    /usr/local/lib/lib
    

    然后:
    ldconfig

    tar zxvf libxml2-2.9.10.tar.gz
    cd libxml2-2.9.10/
    ./configure
    make
    make install
    cd ../

    yum install gcc gcc-c++ autoconf zlib zlib-devel glibc glibc-devel libpng libpng-devel libjpeg-turbo libjpeg-turbo-devel freetype freetype-devel xz gd libmcrypt mhash libxml2 libxml2-devel glib2 glib2-devel bzip2 bzip2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel  libidn  openssl openssl-devel 
    yum install sqlite-devel libcurl-devel oniguruma libzip libzip-devel

    tar xvzf sqlite-autoconf-3071502.tar.gz
    cd sqlite-autoconf-3071502
    ./configure --prefix=/usr/local
    make
    make install

    https://github.com/kkos/oniguruma

    ./configure
    ./configure --prefix=/usr --libdir=/lib64
    make
    sudo make install


3.安装php
    cd php-8.0.3
    export LIBS="-lm -lresolv"
    export DYLD_LIBRARY_PATH="/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64:/usr/libexec/"n
    export LD_LIBRARY_PATH="/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64:/usr/libexec/"
    ./configure \
    --prefix=/usr/local/service/php8.0.3 \
    --with-config-file-path=/usr/local/service/php8.0.3/etc \
    --with-mysqli=shared,mysqlnd \
    --with-pdo-mysql=shared,mysqlnd \
    --enable-opcache \
    --with-iconv=/usr/local/lib/libiconv \
    --with-freetype \
    --with-jpeg \
    --with-libxml \
    --enable-xml \
    --enable-bcmath \
    --enable-shmop \
    --enable-sysvsem \
    --enable-inline-optimization \
    --with-curl \
    --enable-mbregex \
    --enable-fpm \
    --enable-mbstring  \
    --with-openssl \
    --with-mhash \
    --enable-pcntl \
    --enable-sockets \
    --enable-gd \
    --with-zip \
    --enable-soap \
    --with-fpm-user=www \
    --with-fpm-group=www \
    --with-mysql-sock=/data/mysql/mysql.sock \


    --disable-rpath \ (使用后,不会搜索附加的动态链接库,会造成opcache编译不过)
    --with-xmlrpc \ XML-RPC是Userland Software公司设计的一种格式:是一种使用HTTP协议传输XML格式文件来获取远程程序调用(Remote Procedure Call)的传输方式。官方网站是www.xmlrpc.com。
    --enable-maintainer-zts \  pthreads多线程扩展需要开启zts

    
    make 
    make install

    echo -e '\nexport PATH=/usr/local/service/php8.0.3/bin:/usr/local/service/php8.0.3/sbin:$PATH\n' >> /etc/profile && source /etc/profile

4.配置文件

5. 安装扩展
ImageMagick是一套功能强大、稳定而且免费的工具集和开发包,可以用来读、写和处理超过89种基本格式的图片文件

        yum -y install perl-CPAN ImageMagick

        tar zxvf ImageMagick-7.0.7-28.tar.gz
        cd ImageMagick-7.0.7-28
        ./configure
        make
        make install
        cd ../

        tar zxvf imagick-3.4.3.tgz
        cd imagick-3.4.3
        /usr/local/service/php8.0.3/bin/phpize
        ./configure --with-php-config=/usr/local/service/php8.0.3/bin/php-config
        make
        make install
        cd ../

    5.2 redis

    wget https://download.redis.io/releases/redis-6.2.1.tar.gz
    make
    make PREFIX=/usr/local/service/redis install
    cd ../

    mkdir -p /data/redis/6379/
    配置文件:redis.conf
    启动:
    /usr/local/service/redis/bin/redis-server /data/redis/6379/redis.conf & 2&1 > /data/redis/6379/redis.log


    redis.so

    https://github.com/phpredis/phpredis/archive/5.3.3.tar.gz

    tar zxvf 5.3.3.tar.gz 
    cd  phpredis-5.3.3/
    /usr/local/service/php8.0.3/bin/phpize
    ./configure --with-php-config=/usr/local/service/php8.0.3/bin/php-config
    make
    make install
    cd ..


    swoole

    wget https://github.com/swoole/swoole-src/archive/v4.6.3.tar.gz
    tar zxvf v4.6.3.tar.gz
    cd swoole-src-4.6.3
    /usr/local/service/php8.0.3/bin/phpize
    ./configure --with-php-config=/usr/local/service/php8.0.3/bin/php-config --enable-swoole-json
    make
    make install
    cd ..

 

1.composer create-project composer/satis
2.vi satis.json
{

    "name": "composer/jetsong",
    "homepage": "http://satis.jetsong.top",
    "repositories": [{
            "type": "vcs",
            "url": "http://gitlab.sdjian.com:31001/php-base-server/facade/comment-like-base.git"
    }],
    "require": {
            "facade/comment-like-base": "*"
    },
    "require-dependencies": true,
    "archive": {
            "directory": "dist",
            "format": "tar",
            "prefix-url": "http://satis.jetsong.top",
            "skip-dev": true
    },
    "config": {
            "secure-http": false
    }

}
3.php bin/satis build satis.json public/
4.开启服务
server {

listen       31005;
server_name  127.0.0.1;

access_log  /data/logs/nginx/satis.access.log  main;
error_log /data/logs/nginx/satis.error.log;
root   /data/composer/satis/public;

location / {
    index  index.html index.php;
}

error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;
}

location ~ \.php$ {
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi.conf;
}

}
5.使用仓库
{

"repositories":[
    {
        "type":"composer",

"url": "http://satis.jetsong.top"

    }
],

"require": {

    "facade/comment-like-base": "*"
},
"config":{
    "secure-http": false
}

}

How do I install untrusted packages safely? Is it safe to run Composer as superuser or root?#

Certain Composer commands, including exec, install, and update allow third party code to execute on your system. This is from its "plugins" and "scripts" features. Plugins and scripts have full access to the user account which runs Composer. For this reason, it is strongly advised to avoid running Composer as super-user/root.

You can disable plugins and scripts during package installation or updates with the following syntax so only Composer's code, and no third party code, will execute:

composer install --no-plugins --no-scripts ...
composer update --no-plugins --no-scripts ...
The exec command will always run third party code as the user which runs composer.

In some cases, like in CI systems or such where you want to install untrusted dependencies, the safest way to do it is to run the above command.