PHP7.4之编译安装

CentOS 7安装php7.4 阅读详情

  虽然之前写过很多编译安装PHP的文章, 但是隔段时间还是会重新安装一些PHP的版本,再次记录一下

1. 下载安装编译工具

yum groupinstall 'Development Tools'

2.安装依赖包

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel

3. 下载并解压PHP7.4

wget http://mirrors.sohu.com/php/php-7.4.0.tar.gz
# 解压
tar -zxvf php-7.4.0.tar.gz

cd php-7.4.0

4. 新增用户和用户组

groupadd www

useradd -g www www

5. 生成编译文件

复制代码

./configure \ 
--prefix=/usr/local/php \ 
--with-config-file-path=/etc \ 
--with-fpm-user=www \ 
--with-fpm-group=www \  
--with-curl \ 
--with-freetype-dir \ 
--enable-gd \ 
--with-gettext \  
--with-iconv-dir \ 
--with-kerberos \ 
--with-libdir=lib64 \ 
--with-libxml-dir \ 
--with-mysqli \ 
--with-openssl \ 
--with-pcre-regex \ 
--with-pdo-mysql \ 
--with-pdo-sqlite \ 
--with-pear \ 
--with-png-dir \ 
--with-jpeg-dir \ 
--with-xmlrpc \ 
--with-xsl \ 
--with-zlib \ 
--with-bz2 \ 
--with-mhash \ 
--enable-fpm \ 
--enable-bcmath \ 
--enable-libxml \ 
--enable-inline-optimization \ 
--enable-mbregex \ 
--enable-mbstring \ 
--enable-opcache \ 
--enable-pcntl \ 
--enable-shmop \ 
--enable-soap \ 
--enable-sockets \ 
--enable-sysvsem \ 
--enable-sysvshm \ 
--enable-xml \  
--with-zip \ 
--enable-fpm

复制代码

注意:有些编译项需要进行修改可以通过./configure --help  查看具体的项

复制代码

./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --with-fpm-user=www --with-fpm-group=www --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip --enable-fpm

复制代码

6. 编译安装

make  && make install -j 2

  -j 指定执行的进程数

7.安装成功之后,设置环境变量

复制代码

vim /etc/profile

添加
PATH=$PATH:/usr/lcoal/php74/bin
export PATH


立即生效
source  /etc/profile

复制代码

8. 测试查看PHP版本

复制代码

php -v


创建php-fpm软链接
ln -s /usr/local/php74/sbin/php-fpm  /usr/local/php74/bin/php-fpm

php-fpm -v

复制代码

9.配置

复制代码

#将源码中的配置文件复制到PHP的配置文件中

cp php.ini-production /usr/local/php74/etc/php.ini

#将PHP目录中的php-fpm配置文件进行修改
cp php-fpm.conf.default php-fpm.conf

cp php-fpm.d/www.conf.default php-fpm.d/www.conf

复制代码

10.添加php-fpm启动项

复制代码

#将PHP源码中的php-fpm启动文件加入到服务自启动文件中
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

#赋予执行权限
chmod +x /etc/init.d/php-fpm

#启动php-fpm
/etc/init.d/php-fpm  start

复制代码

 11.php-fpm服务化

 centos7 已经使用systemctl来进行服务的管理,这里我们也使用systemctl来对php-fpm进行管理

复制代码

修改php-fpm.conf文件
打开pid=/var/run/php-fpm.pid

cp sapi/fpm/php-fpm.service /usr/lib/systemd/system/php-fpm74.service

ln -s /usr/lib/systemd/system/php-fpm74.service /usr/lib/systemd/system/php-fpm.service

systemctl daemon-reload

systemctl enable php-fpm

复制代码

php-fpm.service文件内容:

复制代码

[Unit]
Description=The PHP FastCGI Process Manager
After=network.target

[Service]
Type=simple
PIDFile=/usr/local/php74/var/run/php-fpm.pid
ExecStart=/usr/local/php74/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php74/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID

PrivateTmp=true
[Install]
WantedBy=multi-user.target

复制代码

停止之前启动的php-fpm, 使用systemctl启动php-fpm

systemctl start php-fpm.service

12.在使用的时候发现zip扩展没有安装,现在需要添加扩展 

在PHP源代码包中,我的源码路径:/opt/php-7.4.0/, 需要进去到zip扩展包中cd  /opt/php-7.4.0/ext/zip

复制代码

#生成配置文件
phpize

./configure --with-php-config=/usr/local/php74/bin/php-config --with-zip

make && make install

在配置文件中开启扩展即可 php.ini

复制代码

常见错误:

  1. error: Package requirements (sqlite3 > 3.7.4) were not met

yum install libsqlite3x-devel -y

  2.error: Package requirements (oniguruma) were not met

yum install oniguruma-devel -y

  3. 访问nginx无法解析PHP文件

复制代码

server {
        listen       8081;
        server_name  localhost; 
        index        index.html index.php;
        root         /data/www;
        
        access_log  /data/logs/www.access.log  main;
        error_log   /data/logs/www.error.log;
        location / {
            if (!-e $request_filename) {
                rewrite ^/(.*) /index.php last;
            }
        }
        
        location ~ .*\.(php|php5)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  # 这里注意需要进行修改
            include        fastcgi_params;
        }
        
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

复制代码

   3. configure: error: Package requirements (libzip >= 0.11) were not met: No package 'libzip'

复制代码

libzip  版本太低了
编译安装,指定PKG_CONFIG_PATH,上面报错中其实有提示信息,让我们考虑调整PKG_CONFIG_PATH环境变量。
下面是详细步骤:

 # 先卸载已有
yum remove libzip
# 然后安装
wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

装完了之后找一下/usr/local/lib下有没有pkgconfig目录,有的话执行命令export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"指定PKG_CONFIG_PATH。
到这里问题解决!

复制代码

    4. 安装扩展的时候,

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment

安装autoconf

yum install -y autoconf
编译安装php7.4的一些踩坑和探索 服务器数据迁移时踩的坑。浅浅记录一下踩坑过程,以防未来再度踩坑。事情是这样的。先前的云服务器快到期了,由于续费很贵,于是我换了一家服务商,最近在断断续续利用闲暇时间做数据迁移。在这个服务器上我有一个dokuwiki的页面,平时用来存放一些笔记和日记的内容,但是迁移到新机器以后,我发现dokuwiki的页面显示出了些问题,所有页面元素渲染全部不正确。 阅读详情

相关推荐

PHP7.4编译安装

Linux Centos7 编译安装 php7.4.29

pengchengxue110的专栏 1812

php7.4编译安装,及重要的拓展库

php7.4编译安装,及重要的拓展库。

qq_39636712的博客 5460

centos7 编译安装php7.4.7

1,先删除所有的php yum remove php 入股之前已经编译安装了其他版本的php rm -rf /usr/local/php /bin/php /usr/local/sbin/php-fpm /usr/local/bin/php /usr/local/bin/pear /usr/local/bin/peardev /usr/local/bin/pecl /usr/local/bin/phar /usr/local/bin/phar.phar /usr/local/bin/php-cg.

梦启未来 3975

Window10安装PHP7.4

首先需要下载PHP 7的安装包,可以从PHP官网(https://www.php.net/downloads.php)或者Windows下的PHP官网(http://windows.php.net/download/)下载Windows版本的PHP 7安装包。根据自己的系统架构(32位或64位)选择下载,下载后解压到一个路径下。在PHP目录中找到php.ini-development文件,将其重命名为php.ini,并且进行修改。将PHP安装的路径(比如C:\php)添加到环境变量中。

南巷清风 7978

centos7.6源码编译安装php7.4

首先安装依赖 yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libzip-devel pcre-devel 下载php7.4压缩包 https://www.php.net/distrib...

php_dandan的博客 3500

debian 编译安装php7.4

1. 安装基础依赖apt-get install libxml2-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libmcrypt-dev libpspell-dev librecode-dev libcurl4-gnutls-dev libg...

qq_34629975的博客 2164

Ubuntu 编译安装 php7.4

安装依赖 sudo apt update sudo apt install gcc -y && sudo apt install make -y && sudo apt install openssl -y && sudo apt install curl -y && sudo apt install libbz2-dev -y &...

Dev.QM的博客 4017

Power BI常见问题篇1:无法打开文档

Power BI常见问题篇1:无法打开文档

weixin_48273257的博客 3305

deepin 编译安装 php7.4

deepin 编译安装 php7.4 扩展的安装 基础的扩展包sudo apt-get install -y gcc autoconf automake libtool cmake m4 bison re2c 依赖的扩展包sudo apt-get -y install libwebp-dev libjpeg-dev libxpm-dev libzip-dev libxslt1-dev libmcrypt-dev libsqlite3-dev libcurl4-openssl-dev libssl-d

javaldk的专栏 784

二维otsu算法python_OpenCV-Python系列之OTSU算法

上一个教程中,我们谈到了关于图像二值化的两种方法,一种是固定阈值法,另一种是自适应阈值法,总的来说,自适应阈值法在某些方面要由于固定阈值法,但还没完,这次我们将隆重介绍我们的重量级选手,也就是OTSU算法(又称为大津算法和最大类间方差法)。最大类间方差法是1979年由日本学者大津提出的,是一种自适应阈值确定的方法,又叫大津法,简称OTSU,是一种基于全局的二值化算法,它是根据图像的灰度特性,将图像...

weixin_28834169的博客 1426

【清风数学建模笔记】第十一讲:时间序列分析

【清风数学建模笔记】第十一讲:时间序列分析

manerzi的博客 833

linux编译安装php7.4及扩展

一、获取包并解压 官网下载 www.php.net/docs.php 或者 wget https://www.php.net/distributions/php-7.4.14.tar.gz tar -zxvf php-7.4.14.tar.gz 二、编译安装 //个人编译项 ./configure --prefix=/opt/apps/php-7.4 --enable-fpm ‘–with-config-file-path=/opt/apps/php-7.4/etc’ ‘–with-confi

Martian 2960

全志Longan和Tina系统T113-S3-(Tina Linux 系统介绍)

Tina Linux是全志科技基于Linux内核开发的针对智能硬件类产品的嵌入式软件系统。Tina Linux基于openwrt-14.07 版本的软件开发包,包含了 Linux 系统开发用到的内核源码、驱动、工具、系统中间件与应用程序包。Tina系统软件架构如图所示。从下至上分别为Kernel && Driver、Libraries、System Services、Applications 四层。

szembed的博客 6339

centos7 源码编译安装php7.4

很多时候可能会遇到需要手动源码安装软件的时候,所以自己实践了一把,并且把安装过程中遇到的问题,以及在网上找到的解决办法(实测有效)都记录下来,方便日后学习实践。永久性设置,只针对一个用户,需要重启生效或使用source命令,优先级高于2,将方式1的导出操作添加到文件 ~/.bashrc的末尾。永久性设置,对所有用户有效,需要重启生效或使用source命令,将上一种方式的导出操作添加到文件/etc/profile的末尾。一次性的设置,只对当前会话有效,当注销时,刚刚设置的PATH就会失效。

co1590的博客 4231

基于 YOLOv26 的光伏板热斑检测系统:红外+可见光

本文提出了一种基于YOLOv26的光伏板热斑检测系统,采用红外+可见光双模态融合方案。系统架构包含数据预处理、热斑检测、故障诊断和维修决策等模块,结合无人机巡检与地面监控。关键技术包括YOLOv26目标检测模型、双模态数据融合、边缘计算部署等。研究构建了包含多种故障类型的光伏板专业数据集,并采用数据增强技术提升模型性能。系统实现了热斑检测、分类(轻微/中等/严重/危急)以及功率损失评估等功能,为光伏电站智能运维提供解决方案。

一键难忘的博客 497

Windows 11 安装 MySQL 8.4:安装包方式、下载、安装、使用

本文详细介绍了在 Windows 11 系统下通过 MSI 安装包方式安装 MySQL 8.4 LTS 社区版的完整流程,包括版本选择、下载、自定义安装路径、服务配置、日志设置、示例数据库创建及后续使用方法。同时提供了命令行客户端与图形化工具 DBeaver 的连接与操作演示,适合初学者和开发者快速搭建本地 MySQL 开发环境。

寒水馨 · 轻量级技术文档 · hanshuixin.org 2263

linux 编译安装PHP7.4.9

原文链接:https://www.cpweb.top/569 1、安装php依赖 [root@web01 ~]# yum install gcc gcc-c++ libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libm...

supahero的博客 1865

YOLO26改进策略【YOLO和Mamba】| 2024 VM-UNet,高效的特征提取模块VSS block 二次创新提高精度

VM-UNet模型设计的出发点是解决现有CNN-based和模型在医学图像分割中的局限性,利用(SSMs)的优势,提出一种更有效的医学图像分割模型。具体来说,CNN-based模型在捕捉长距离信息方面存在不足,而模型由于自注意力机制的二次复杂度导致计算负担较重。SSMs模型如Mamba不仅在建模长距离依赖方面表现出色,还具有线性计算复杂度,这为VM-UNet的设计提供了理论基础。

Limiiiing的博客 217

centos7源码编译php,CentOS7下源码编译安装PHP7.4

操作系统:CentOS7安装版本:PHP7.41)到PHP官网下载PHP7.4,并且解压cd /home/install/phpwget https://www.php.net/distributions/php-7.4.12.tar.gztar -zxvf php-7.4.12.tar.gz1.png2)切换到解压目录编译配置#更多可以在 ./configure --help 去查看./con...

weixin_30191947的博客 810

ORB-SLAM3代码详解 - 第 18 篇 · Atlas 多地图系统、地图保存与全系统调优

会跑:理解三线程架构与数据流(01/08/10/13),能编译、配参、复现各数据集结果。会改:掌握相机模型抽象(05)、g2o 顶点与边(14)、预积分(15),能接入新传感器、新相机、新约束。会调:理解每个参数背后的物理含义与耦合(03/15/16/18),能针对自己的平台与场景做精度/实时/鲁棒的权衡。ORB-SLAM3 的价值不止于一个可用的 SLAM 系统,更在于它是一套工程化的几何状态估计模板:清晰的模块边界、可替换的相机/传感器抽象、紧耦合优化的标准范式。

PX4-SLAM-PNC 172

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

PHP7.4.6源码编译安装

php源码编译安装 总的需要以下命令行,下面有详细截图步骤讲解(如果有遇到问题,请留言评论)

qq_41261340的博客 895

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Linux编译安装PHP7.4.24及启动

Linux编译安装PHP7.4.24及启动1. 下载安装包PHP安装包2. 配置安装包2.1 先安装前置插件,不管有没有都安装一下2.2 配置php2.3 执行配置命令可能会出现如下错误2.4 运行php的配置命令出现如下示例,即为配置成功3编译安装包3.1 执行编译命令(可能要花一点时间)3.2 在之前编译的源码包中,找到 php.ini-production,复制到/usr/local/php下,并改名为php.ini:3.2 修改配置文件3.3 新建用户组及用户4. 启动停止php-fpm4.1 启

陈家老二的博客 1万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

centos7编译安装php7.4.13

1.php安装依赖 yum -y install epel-release yum -y install gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses nc

知音的博客 2411

编译安装最新PHP 7.4 alpha

编译安装 wget https://downloads.php.net/~derick/php-7.4.0alpha1.tar.gz 解压 tar xvf php-7.4.0alpha1.tar.gz 进入目录 然后 ./buildconf 因为我要安装 PHP 到目录 /www/server/php/74,你可以改成其他目录(如 /usr/local/php/74),也可以用这个目录。...

谢谢你,慌乱了我的年华 1419

centos7编译安装php7.4

centos7源码编译安装php7.4

T_Struggle的博客 4542

PHP7.4编译安装问题解决

PHP7.4编译安装问题解决 PHP 7+ 版本极大地改进了性能,在一些WordPress基准测试当中,性能可以达到PHP 5.6的3倍。而PHP 5.6版本在2018年底官方已经不再维护,升级PHP 7是必然选择。 centos7 编辑安装php遇到的问题: 解决 configure: error: no acceptable C compiler found in $PATH 错误 yum install -y gcc gcc-c++ 解决 error: the HTTP XSLT module req

yunweigo的博客 2474
上一篇: Nginx 错误502 upstream sent too big header while reading response header from upstream
下一篇: CentOS 卸载软件
firstcode666
博客等级 码龄5年 53粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值