当前位置:首页 » 操作系统 » linux安装freetype

linux安装freetype

发布时间: 2023-09-20 09:55:56

linux6.5,LAMP环境都搭建好了进入页面却安装不了,为什么

1、确认搭建LAMP所需的环境是否已经安装:
[root@localhost ~]#rpm -q make gcc gcc-c++ zlib-devel libtool libtool-ltdl libtool-ltdl-devel bisonncurses-devel
备注:安装libpng时需要zlib-devel
安装php时需要libtool、libtool-ltdl、libtool-ltdl-devel
安装mysql时需要bison、ncurses-devel

2、如果没安装则yum安装:
[root@localhost~]#yum -y install make gcc gcc-c++ zlib-devel libtool libtool-ltdllibtool-ltdl-devel bison ncurses-devel

3、由于要使用编译安装,所以查看httpd、mysql、php是否安装:
[root@localhost ~]#rpm -q httpd mysql php
如果安装则卸载:
[root@localhost ~]#rpm -e httpd --nodeps
[root@localhost ~]#rpm -e mysql --nodeps
[root@localhost ~]#rpm -e php --nodeps

编译安装过程介绍:
1)解压tar.gz为后缀的压缩软件包:LAMP环境搭建所需要的每个软件的软代码文激首件,都是以tar.gz或.tgz提供给我们的打包压缩文件,所以我们必须将其解压再解包。命令如下:
tar–zxvf *.tar.gz
2)在linux系统中源代码包安装过程:LAMP环境搭建所需要的软件都是使用C语言明衡数开发的,所以安装源代码文件最少需要配置、编译和安装三个步骤
配置(configure)、编译(make)、安装(makeinstall)

4、编译安装libxml2
[root@localhostlinux]# tar -zxvf libxml2-2.6.30.tar.gz
[root@localhostlinux]# cd libxml2-2.6.30
[[email protected]]# ./configure --prefix=/usr/local/libxml2
[[email protected]]# make
[[email protected]]# make install

5、编译安装libmcrypt
[root@localhostlinux]# tar -zxvf libmcrypt-2.5.8.tar.gz
[root@localhostlinux]# cd libmcrypt-2.5.8
[[email protected]]# ./configure --prefix=/usr/local/libmcrypt
[[email protected]]# make
[[email protected]]# make install

6、编译安装zlib
[root@localhostlinux]# tar -zxvf zlib-1.2.3.tar.gz
[root@localhostlinux]# cd zlib-1.2.3
[[email protected]]# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib/
(用64位元的方法进行编译)
[[email protected]]# make
[[email protected]]# make install

7、编译安装libpng
[root@localhostlinux]# tar -zxvf libpng-1.2.31.tar.gz
[root@localhostlinux]# cd libpng-1.2.31
[[email protected]]# ./configure --prefix=/usr/拦镇local/libpng \
>--enable-shared (建立共享库使用的GNU的libtool)
[[email protected]]# make
[[email protected]]# make install

8、编译安装jpeg
[root@localhostlinux]# tar -zxvf jpegsrc.v6b.tar.gz
[root@localhostlinux]# cd jpeg-6b
[root@localhostjpeg-6b]# mkdir /usr/local/jpeg (创建jpeg软件的安装目录)
[root@localhostjpeg-6b]# mkdir /usr/local/jpeg/bin (创建存放命令的目录)
[root@localhostjpeg-6b]# mkdir /usr/local/jpeg/lib (创建jpeg库文件所在目录)
[root@localhostjpeg-6b]# mkdir /usr/local/jpeg/include (创建存放头文件目录)
[root@localhostjpeg-6b]# mkdir -p /usr/local/jpeg/man/man1 (建立存放手册的目录)
[root@localhostjpeg-6b]# ./configure --prefix=/usr/local/jpeg \
>--enable-shared \ (建立共享库使用的GUN的libtool)
>--enable-static (建立静态库使用的GUN的libtool)
[root@localhostjpeg-6b]# make
[root@localhostjpeg-6b]# make install

执行make时如果出现如下错误:
./libtool --mode=compile gcc-O2 -I. -c ./jcapimin.c
make: ./libtool: Command notfound
make: *** [jcapimin.lo] Error 127
解决方法:
默认已安装libtool及libtool-ltdl-devel(如需帮助请看过程2)
[root@localhostjpeg-6b]# find / -name config.sub
/usr/share/libtool/config/config.sub
[root@localhostjpeg-6b]# find / -name config.guess
/usr/share/libtool/config/config.guess
[root@localhostjpeg-6b]# cp -vRp /usr/share/libtool/config/config.sub .
[root@localhostjpeg-6b]# cp -vRp /usr/share/libtool/config/config.guess .
也就是把libtool里面的两个配置文件拿来覆盖掉jpeg-6b目录下的对应文件
make clean 再重新configure

9、编译安装freetype
[root@localhostlinux]# tar -zxvf freetype-2.3.5.tar.gz
[root@localhostlinux]# cd freetype-2.3.5
[[email protected]]# ./configure --prefix=/usr/local/freetype \
>--enable-shared (建立共享库使用的GUN的libtool)
[[email protected]]# make
[[email protected]]# make install

10、编译安装autoconf
[root@localhostlinux]# tar -zxvf autoconf-2.61.tar.gz
[root@localhostlinux]# cd autoconf-2.61
[[email protected]]# ./configure
[[email protected]]# make
[[email protected]]# make install

11、编译安装GD
[root@localhostlinux]# tar -zxvf gd-2.0.35.tar.gz
[root@localhostlinux]# cd gd-2.0.35
[[email protected]]# ./configure --prefix=/usr/local/gd \
>--with-zlib=/usr/local/zlib/ \ (指定zlib库文件的位置)
>--with-jpeg=/usr/local/jpeg/ \ (指定jpeg库文件的位置)
>--with-png=/usr/local/libpng/ \ (指定png库文件的位置)
>--with-freetype=/usr/local/freetype/ (指定freetype字体库的位置)
[[email protected]]# make
[[email protected]]# make install

执行make时如果出现如下错误:
make[2]: *** [gd_png.lo] Error 1
make[2]: Leaving directory`/usr/src/linux/gd-2.0.35'
make[1]: *** [all-recursive]Error 1
make[1]: Leaving directory`/usr/src/linux/gd-2.0.35'
make: *** [all] Error 2
解决方法:
[[email protected]]# find / -name gd_png.c
/usr/src/linux/gd-2.0.35/gd_png.c
[[email protected]]# find / -name png.h
/usr/local/libpng/include/png.h
[[email protected]]# vi /usr/src/linux/gd-2.0.35/gd_png.c
将#include "png.h"
改为#include "/usr/local/libpng/include/png.h"

12、编译安装apache
[root@localhostlinux]# tar -zxvf httpd-2.2.9.tar.gz
[root@localhostlinux]# cd httpd-2.2.9
[[email protected]]# ./configure --prefix=/usr/local/apache \
> --enable-so \ (以动态共享对象编译)
>--enable-rewrite (基于规则的URL操控)
[[email protected]]# make
[[email protected]]# make install
将apache加入开机启动↓
[[email protected]]# cp -vRp /usr/local/apache/bin/apachectl /etc/init.d/httpd
[[email protected]]# chmod +x /etc/init.d/httpd
添加apache服务↓
[[email protected]]# chkconfig --add httpd
[[email protected]]# chkconfig --level 2345 httpd on
[[email protected]]# service httpd start

启动服务时,如果出现如下错误:
httpd: Could not reliablydetermine the server's fully qualified domain name, using localhost.localdomainfor ServerName
解决方法:
[[email protected]]# vi /usr/local/apache/conf/httpd.conf
添加上:ServerName localhost:80

执行chkconfig时,如果出现如下错误:
service httpd does not supportchkconfig
解决方法:
[[email protected]]# vi /etc/rc.d/init.d/httpd
在文件第二行加入
#chkconfig:2345 10 90
#description:Activates/DeactivatesApache Web Server
保存后再执行chkconfig

13、编译安装mysql(最新版本都需要cmake编译安装)

编译安装 cmake
[root@localhostlinux]# tar -zxvf cmake-2.8.7.tar.gz
[root@localhostlinux]# cd cmake-2.8.7
[[email protected]]# ./bootstrap
[[email protected]]# gmake
[[email protected]]# gmake install

编译安装 MySQL5.5.20
[[email protected]]# groupadd mysql
[[email protected]]# useradd -g mysql mysql
[root@localhostlinux]# tar -zxvf mysql-5.5.15.tar.gz
[root@localhostlinux]# cd mysql-5.5.15
[[email protected]]#
cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ (安装根目录)
> -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock \ (UNIX socket文件)
>-DDEFAULT_CHARSET=utf8 \ (默认字符集)
>-DDEFAULT_COLLATION=utf8_general_ci \ (默认编码)
>-DWITH_EXTRA_CHARSETS=utf8,gbk \ (额外的编码)
>-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \(启用PERFSCHEMA引擎支持)
>-DWITH_FEDERATED_STORAGE_ENGINE=1 \ (启用FEDERATED引擎支持)
> -DWITH_PARTITION_STORAGE_ENGINE=1\ (启用PARTITION引擎支持)
>-DWITH_ARCHIVE_STORAGE_ENGINE=1 \ (启用ARCHIVE引擎支持)
>-DWITH_READLINE=1 \(使用readline功能)
>-DMYSQL_DATADIR=/usr/local/mysql/data \ (数据库数据目录)
>-DMYSQL_TCP_PORT=3306 (TCP/IP端口)
[[email protected]]# make
[[email protected]]# make install
[[email protected]]# cp -vRp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
修改配置文件↓
[[email protected]]# vi /etc/my.cnf
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
log-error=/usr/local/mysql/data/error.log
pid-file=/usr/local/mysql/data/mysql.pid
初始化数据库文件↓
[[email protected]]# /usr/local/mysql/scripts/mysql_install_db \
>--defaults-flie=/etc/my.cnf \
> --basedir=/usr/local/mysql/\
>--datadir=/usr/local/mysql/data \
>--pid-file=/usr/local/mysql/data/mysql.pid \
> --user=mysql
权限设置↓
[root@localhostmysql]# chown -R root .
[root@localhostmysql]# chown -R mysql data
[root@localhostmysql]# chgrp -R mysql .
将mysql加入开机启动↓
[root@localhostmysql]# cp -vRp support-files/mysql.server /etc/init.d/mysqld
[root@localhostmysql]# chmod +x /etc/init.d/mysqld
添加mysql服务↓
[root@localhostmysql]# chkconfig --add mysqld
[root@localhostmysql]# chkconfig --level 345 mysqld on
[root@localhostmysql]# service mysqld start
配置mysql↓
[root@localhostmysql]# bin/mysql
mysql> deletefrom mysql.user where Host!='localhost'; (只留允许本机登录的帐号)
mysql> flushprivileges; (刷新授权表)
mysql> setpassword for 'root'@'localhost'=password('123456'); (设置用户密码)
mysql> exit
[root@localhostmysql]# bin/mysql -h localhost -u root -p123456 (登录mysql)

14、编译安装php
[root@localhostlinux]# tar -zxvf php-5.3.19.tar.gz
[root@localhostlinux]# cd php-5.3.19
[[email protected]]# ./configure --prefix=/usr/local/php \
>--with-apxs2=/usr/local/apache/bin/apxs \
>--with-mysql=/usr/local/mysql/ \
>--with-libxml-dir=/usr/local/libxml2/ \
>--with-png-dir=/usr/local/libpng/ \
>--with-jpeg-dir=/usr/local/jpeg/ \
>--with-freetype-dir=/usr/local/freetype/ \
> --with-gd=/usr/local/gd/\
>--with-mcrypt=/usr/local/libmcrypt/ \
>--with-mysqli=/usr/local/mysql/bin/mysql_config \
> --enable-soap\ (变量激活SOAP和web services支持)
>--enable-mbstring=all \ (使多字节字符串支持)
>--enable-sockets (变量激活socket通讯特性)
[[email protected]]# make
[[email protected]]# make install
[[email protected]]# cp -vRp php.ini-development /etc/php.ini
[[email protected]]# vi /usr/local/apache/conf/httpd.conf
添加上:
AddType application/x-httpd-php .php
[[email protected]]# service httpd stop
[[email protected]]# service httpd start
[[email protected]]# vi /usr/local/apache/htdocs/phpinfo.php
添加内容为:
<?php
phpinfo();
?>
打开浏览器进行访问,如果出现PHP版本界面,及安装成功。

⑵ 如何在linux下安装多个不同版本的PHP

Linux (测试环境 Ubuntu 12.04 Server X86_64)
1. 安装编译工具及所需类库
$ sudo apt-get install build-essential gcc g++ autoconf libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev bzip2 libbz2-dev openssl libssl-dev curl libcurl4-openssl-dev libpcre3 libpcre3-dev libevent-1.4-2 libevent-dev libmcrypt4 libmcrypt-dev mcrypt libltdl-dev libldap2-dev libsasl2-dev libmhash-dev libc-client2007e libc-client2007e-dev
2. 安装MySQL
$ sudo apt-get install mysql-server libmysqlclient-dev
3. 安装PHP
Linux下多版本PHP共存需要自己手工编译安装。
下载PHP源文件到/opt/src目录
$ mkdir /opt/src
$ cd /opt/src
$ wget http://museum.php.net/php5/php-5.2.17.tar.bz2 -O php-5.2.17.tar.bz2
$ wget http://cn2.php.net/get/php-5.3.28.tar.bz2/from/this/mirror -O php-5.3.28.tar.bz2
$ wget http://cn2.php.net/get/php-5.4.29.tar.bz2/from/this/mirror -O php-5.4.29.tar.bz2
$ wget http://cn2.php.net/get/php-5.5.14.tar.bz2/from/this/mirror -O php-5.5.14.tar.bz2
创建PHP各版本安装目录
$ mkdir -p /opt/php/{5217,5328,5429,5514}
安装PHP 5.2.17
$ cd /opt/src
$ tar -xvjf php-5.2.17.tar.bz2
$ cd php-5.2.17
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/libpng.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libkrb5.so /usr/lib/libkrb5.so
$ wget -O debian_patches_disable_SSLv2_for_openssl_1_0_0.patch “https://bugs.php.net/patch-display.php?bug_id=54736&patch=debian_patches...”
$ patch -p1 < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch
$ ./configure --prefix=/opt/php/5217 --with-config-file-scan-dir=/opt/php/5217/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-mime-magic --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-recommended /opt/php/5217/lib/php.ini
安装PHP 5.3.28
$ cd /opt/src
$ tar -xvjf php-5.3.28.tar.bz2
$ cd php-5.3.28
$ ./configure --prefix=/opt/php/5328 --with-config-file-scan-dir=/opt/php/5328/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-development /opt/php/5328/lib/php.ini
安装PHP 5.4.29
$ cd /opt/src
$ tar -xvjf php-5.4.29.tar.bz2
$ cd php-5.4.29
$ ./configure --prefix=/opt/php/5429 --with-config-file-scan-dir=/opt/php/5429/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-development /opt/php/5429/lib/php.ini
安装PHP 5.5.14
$ cd /opt/src
$ tar -xvjf php-5.5.14.tar.bz2
$ cd php-5.5.14
$ ./configure --prefix=/opt/php/5514 --with-config-file-scan-dir=/opt/php/5514/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-development /opt/php/5514/lib/php.ini
4. 安装Apache
$ sudo apt-get install apache2
启用相应模块
$ a2enmod headers
$ a2enmod expires
$ a2enmod actions
$ a2enmod rewrite
5. 配置Apache
$ sudo vi /etc/apache2/httpd.conf
追加如下脚本映射和虚拟主机配置,原理同Windows的配置说明。
ServerName localhost
AddType application/x-httpd-php .php
ScriptAlias /php-5217/ "/opt/php/5217/bin/"
ScriptAlias /php-5328/ "/opt/php/5328/bin/"
ScriptAlias /php-5429/ "/opt/php/5429/bin/"
ScriptAlias /php-5514/ "/opt/php/5514/bin/"
<Directory /var/www/sites>
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php index.html
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/sites/5217>
Action application/x-httpd-php "/php-5217/php-cgi"
</Directory>
<Directory /var/www/sites/5328>
Action application/x-httpd-php "/php-5328/php-cgi"
</Directory>
<Directory /var/www/sites/5429>
Action application/x-httpd-php "/php-5429/php-cgi"
</Directory>
<Directory /var/www/sites/5514>
Action application/x-httpd-php "/php-5514/php-cgi"
</Directory>
# Virtualhosts
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5217/test.local"
ServerName php5217.local
ErrorLog "/var/log/apache2/php5217.local-error.log"
CustomLog "/var/log/apache2/php5217.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5328/test.local"
ServerName php5328.local
ErrorLog "/var/log/apache2/php5328.local-error.log"
CustomLog "/var/log/apache2/php5328.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5429/test.local"
ServerName php5429.local
ErrorLog "/var/log/apache2/php5429.local-error.log"
CustomLog "/var/log/apache2/php5429.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5514/test.local"
ServerName php5514.local
ErrorLog "/var/log/apache2/php5514.local-error.log"
CustomLog "/var/log/apache2/php5514.local-access.log" common
</VirtualHost>
保存配置后,创建各站点的DocumentRoot目录,再往每个目录放置一个phpinfo的测试文件,完成后重启Apache服务器并在本地hosts文件加入域名解析,现在就可以访问各站点来测试多版本PHP共存了。

好了,基本的多版本PHP共存解决方案已经完成,如果还需要添加其他的PHP类库支持,后续自己再调用对应php目录下的pecl, php_config等脚本编译安装就可以了。

⑶ Linux安装apxs

  • 1、 安装准备

#更新系统

yum -y update

#然后安装相关的编译器和必备的软件

yum -y install bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel cairo-devel libtiff libtiff-devel libjpeg libjpeg-devel giflib giflib-devel libpng libpng-devel libX11 libX11-devel freetype freetype-devel fontconfig fontconfig-devel libexif libexif-devel libXft-devel ghostscript-devel gnome-doc-utils unzip

  • 2 、下载安装所需要的软件包

统一下载到/usr/local/src下

wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2

wget http://download.mono-project.com/sources/mono/mono-2.10.8.tar.bz2

wget http://download.mono-project.com/sources/xsp/xsp-2.10.tar.bz2

wget http://download.mono-project.com/sources/mod_mono/mod_mono-2.10.tar.bz2

wget http://apache.fayea.com/apache-mirror//httpd/httpd-2.2.27.tar.gz

  • 3.安装libgdiplus

libgdiplus是mono中的System.Drawing依赖的一个组件,用于显示web页面基本颜色等。

cd /usr/local/src

tar -xjvf libgdiplus-2.10.tar.bz2

cd libgdiplus-2.10

./configure --prefix=/usr/local

make

make install

  • 4.安装mono

cd /usr/local/src

tar -xjvf mono-2.10.8.tar.bz2

cd mono-2.10.8

./configure --prefix=/usr/local

make

make install

Mono安装完成之后,可以用命令mono -V查看一下mono的安装情况,如果能够看到mono版本号等信息,说明Mono安装成功。

  • 5.安装apache

cd /usr/local/src

tar -zxvf httpd-2.2.27.tar.gz

cd httpd-2.2.27

./configure --prefix=/usr/local/apache --enable-mods-shared=most

make

make install


  • 6.安装mod_mono

cd /usr/local/src

tar -xjvf mod_mono-2.10.tar.bz2

cd mod_mono-2.10

./configure

make

make install


  • 7.安装xsp

xsp就是mod-mono-server。

安装之前,先设置一下环境变量

vi /etc/profile #在最后加上下面这句

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

source /etc/profile 或者注销重新登陆一下

cd /usr/local/src

tar -xjvf xsp-2.10.2.tar.bz2

cd xsp-2.10.2

./configure --prefix=/usr/local

make

make install


  • 8.配置apache

打开/usr/local/apache/conf文件夹中的httpd.conf,这个文件是apache的配置文件,在最后添加

Include /usr/local/apache/conf/mod_mono.conf

将以下#注释去掉

#ServerName www.example.com:80

在/usr/local/apache/htdocs文件夹中任意创建一个index.aspx文件,添加内容如下

<%@ Page Language="C#" %>

<html>

<head>

<title>hello world</title>

</head>

<body>

<%

for (int i=1; i<=7; i++)

{

Response.Write("<font size=" + i.ToString() + ">");

Response.Write("hello world");

Response.Write("</font><br />");

}

%>

</body>

</html>

当然,你也可以网络,去下载一个asp.net探针

重启apache

/usr/local/apache/bin/apachectl restart

通过浏览器访问http://IP/index.aspx,测试asp.net环境搭建是否成功,如果返回“hello world” 说明安装成功

⑷ linux 怎么安装nginx

Centos7配置Nginx+PHP7Web服务

作者:JadeGlorious

1、安装相应的扩展支持;

yuminstallgcc-c++
yuminstallpcrepcre-devel
yuminstallzlibzlib-devel
yuminstallopensslopenssl-devel
yum-yinstalllibjpeglibjpeg-devellibpnglibpng-develfreetypefreetype-devellibxml2libxml2-develmysqlpcre-devel
yum-yinstallcurl-devellibxslt-devel

集成至一行命令一次安装
yum-yinstalllibjpeglibjpeg-devellibpnglibpng-develfreetypefreetype-devellibxml2libxml2-develmysqlpcre-develgcc-c++pcrepcre-develpcrepcre-developensslopenssl--develcurl-devellibxslt-devel

如有不能成功安装的,单独再安装一次即可;
2、编译安装Nginx最新版本
//检查是否已经安装nginx

$find/-namenginx

//如果已经安装nginx先卸载掉

$yumremovenginx

//进入习惯使用的下载目录,下载想要使用的nginx版

$wgethttp://nginx.org/download/nginx-1.7.4.tar.gz

//解压nginx安装包

$tar-zxvfnginx-1.7.4.tar.gz

//进入解压后的目录

$cdnginx-1.7.4

//配置安装信息,要加载什么扩展,安装到什么目录之类的
//使用--prefix参数指定nginx安装的目录,make、makeinstall安装

$./configure$默认安装在下载目录

//指定目录

$./configure--prefix=/usr/local/nginx//指定安装在/usr/local/nginx

//编译安装

$make&&makeinstall

//检查是否安装成功

$whereisnginx

3、编译安装PHP7

//下载、解压、进入目录:

$wgethttp://downloads.php.net/~ab/php-7.0.6RC1.tar.gz
$tar-zxvfphp-7.0.6RC1.tar.gz$cdphp-7.0.6RC1

//配置安装信息、扩展

$./configure--prefix=/usr/local/php--exec-prefix=/usr/local/php--bindir=/usr/local/php/bin--sbindir=/usr/local/php/sbin--includedir=/usr/local/php/include--libdir=/usr/local/php/lib/php--mandir=/usr/local/php/php/man--with-config-file-path=/usr/local/php/etc--with-mysql-sock=/var/run/mysql/mysql.sock--with-mhash--with-openssl--with-mysql=shared,mysqlnd--with-mysqli=shared,mysqlnd--with-pdo-mysql=shared,mysqlnd--with-gd--with-iconv--with-zlib--enable-zip--enable-inline-optimization--disable-debug--disable-rpath--enable-shared--enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-mbregex--enable-mbstring--enable-ftp--enable-gd-native-ttf--enable-pcntl--enable-sockets--with-xmlrpc--enable-soap--without-pear--with-gettext--enable-session--with-curl--with-jpeg-dir--with-freetype-dir--enable-opcache--enable-fpm--enable-fastcgi--with-fpm-user=nginx--with-fpm-group=nginx--without-gdbm--disable-fileinfo

//编译检查不通过,缺少什么扩展安装了重新检测,通过后编译安装

$makeclean&&make&&makeinstall

maketest

配置文件
#cpphp.ini-development/usr/local/php/lib/php.ini
#cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
#cp/usr/local/php/etc/php-fpm.d/www.conf.default/usr/local/php/etc/php-fpm.d/www.conf#cp-R./sapi/fpm/php-fpm/etc/init.d/php-fpm

//安装完成后修改nginx配置文件nginx.conf,添加对php的支持,指定项目目录,完成后重启nginx
//启动php-fpm

#/etc/init.d/php-fpm

⑸ Linux CentOS安装PHP多版本同时运行

mkdir -p /lnmp/php74

wget https://www.php.net/distributions/php-7.4.33.tar.gz
tar -zxvf php-7.4.33

cd ./php-7.4.33

./configure --prefix=/lnmp/php74 --enable-fpm --with-mysqli --with-curl --with-pdo_mysql --with-pdo_sqlite --enable-mysqlnd --enable-mbstring --with-gd --with-freetype
(7.4之前的版本freetype是 --with-freetype-dir )
make
make install

cp php.ini-development /lnmp/php74/lib/php.ini
cd /lnmp/php74/etc
mv php-fpm.conf.default php-fpm.conf
mv php-fpm.d/www.conf.default php-fpm.d/www.conf

cd /lnmp/php71/etc/php-fpm.d
vim www.conf

cgi.fix_pathinfo=0

/lnmp/php71/sbin/php-fpm

ps aux|grep php

vim /etc/init.d/php71-fpm

chmod a+x /etc/init.d/php71-fpm

chkconfig --add php71-fpm

service php71-fpm start
service php71-fpm restar
service php71-fpm stop

⑹ linuxphp网站怎么安装

配置php服务

安饥塌装yasm汇编器(解压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvfyasm-1.2.0.tar.gz

[root@linuxprobesrc]cdyasm-1.2.0

[[email protected]]./configure

[[email protected]]make

[[email protected]]makeinstall

安装libmcrypt加密算法扩展库(解烂银圆压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvflibmcrypt-2.5.8.tar.gz

[root@linuxprobesrc]cdlibmcrypt-2.5.8

[[email protected]]./configure

[[email protected]]make

[[email protected]]makeinstall

安装libvpx视频编码器(解压与编译过程搏旦已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarxjvflibvpx-v1.3.0.tar.bz2

[root@linuxprobesrc]cdlibvpx-v1.3.0

[[email protected]]./configure--prefix=/usr/local/libvpx--enable-shared--enable-vp9

[[email protected]]make

[[email protected]]makeinstall

安装Tiff标签图像文件格式(解压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvftiff-4.0.3.tar.gz

[root@linuxprobesrc]cdtiff-4.0.3

[[email protected]]./configure--prefix=/usr/local/tiff--enable-shared

[[email protected]]make

[[email protected]]makeinstall

安装libpng图片(png格式)函数库(解压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvflibpng-1.6.12.tar.gz

[root@linuxprobesrc]cdlibpng-1.6.12

[[email protected]]./configure--prefix=/usr/local/libpng--enable-shared

[[email protected]]make

[[email protected]]makeinstall

安装freetype字体引擎(解压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvffreetype-2.5.3.tar.gz

[root@linuxprobesrc]cdfreetype-2.5.3

[[email protected]]./configure--prefix=/usr/local/freetype--enable-shared

[[email protected]]make

[[email protected]]makeinstall

安装jpeg图片(jpeg格式)函数库(解压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvfjpegsrc.v9a.tar.gz

[root@linuxprobesrc]cdjpeg-9a

[root@linuxprobejpeg-9a]./configure--prefix=/usr/local/jpeg--enable-shared

[root@linuxprobejpeg-9a]make

[root@linuxprobejpeg-9a]makeinstall

安装libgd图像处理程序(解压与编译过程已省略):

[root@linuxprobejpeg-9a]cd/usr/local/src

[root@linuxprobesrc]tarzxvflibgd-2.1.0.tar.gz

[root@linuxprobesrc]cdlibgd-2.1.0

[[email protected]]./configure--prefix=/usr/local/libgd--enable-shared--with-jpeg=/usr/local/jpeg--with-png=/usr/local/libpng--with-freetype=/usr/local/freetype--with-fontconfig=/usr/local/freetype--with-xpm=/usr/--with-tiff=/usr/local/tiff--with-vpx=/usr/local/libvpx

[[email protected]]make

[[email protected]]makeinstall

安装t1lib图片生成函数库(解压与编译过程已省略):

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]tarzxvft1lib-5.1.2.tar.gz

[root@linuxprobesrc]cdt1lib-5.1.2

[[email protected]]./configure--prefix=/usr/local/t1lib--enable-shared

[[email protected]]make

[[email protected]]makeinstall

将函数库文件放至合适的位置:

[[email protected]]cd/usr/local/src

[root@linuxprobesrc]ln-s/usr/lib64/libltdl.so/usr/lib/libltdl.so

[root@linuxprobesrc]cp-frp/usr/lib64/libXpm.so*/usr/lib/

安装php服务程序(命令比较长,请一定要复制完整!!!):

[root@linuxprobesrc]tar-zvxfphp-5.5.14.tar.gz

[root@linuxprobesrc]cdphp-5.5.14

[[email protected]]exportLD_LIBRARY_PATH=/usr/local/libgd/lib

[[email protected]]./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config--with-mysql-sock=/tmp/mysql.sock--with-pdo-mysql=/usr/local/mysql--with-gd--with-png-dir=/usr/local/libpng--with-jpeg-dir=/usr/local/jpeg--with-freetype-dir=/usr/local/freetype--with-xpm-dir=/usr/--with-vpx-dir=/usr/local/libvpx/--with-zlib-dir=/usr/local/zlib--with-t1lib=/usr/local/t1lib--with-iconv--enable-libxml--enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--enable-opcache--enable-mbregex--enable-fpm--enable-mbstring--enable-ftp--enable-gd-native-ttf--with-openssl--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--without-pear--with-gettext--enable-session--with-mcrypt--with-curl--enable-ctype

[[email protected]]make

[[email protected]]makeinstall

复制php服务程序的配置文件到安装目录:

[[email protected]]cpphp.ini-proction/usr/local/php/etc/php.ini

删除默认的php配置文件:

[[email protected]]rm-rf/etc/php.ini

创建php配置文件的软连接到/etc/目录中:

[[email protected]]cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf

[[email protected]]ln-s/usr/local/php/etc/php-fpm.conf/etc/php-fpm.conf

[[email protected]]ln-s/usr/local/php/etc/php.ini/etc/php.ini

编辑php服务程序的配置文件:

[[email protected]]vim/usr/local/php/etc/php-fpm.conf

//将第25行参数前面的分号去掉。

pid=run/php-fpm.pid

//修改第148和149行,将user与group修改为www。

user=www

group=www

添加php-fpm服务程序到开机启动项:

[[email protected]]cpsapi/fpm/init.d.php-fpm/etc/rc.d/init.d/php-fpm

[[email protected]]chmod+x/etc/rc.d/init.d/php-fpm

[[email protected]]chkconfigphp-fpmon

为了保障网站的安全性,禁用掉不安全的功能:

[[email protected]]vim/usr/local/php/etc/php.ini

//修改第305行的disable_functions参数,追加参数为:

disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname

配置nginx服务程序支持php:

[[email protected]]vim/usr/local/nginx/conf/nginx.conf

//将第2行前面的号去掉并修改为userwwwwww;

//将第45行参数修改为indexindex.htmlindex.htmindex.php;

//将第65-71行前面的号去掉,修改为:

location~.php${

roothtml;

fastcgi_pass127.0.0.1:9000;

fastcgi_indexindex.php;

fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;

includefastcgi_params;

}

重启nginx与php-fpm服务程序:

[[email protected]]systemctlrestartnginx

[[email protected]]systemctlrestartphp-fpm

热点内容
如何用安卓编译项目 发布:2025-01-24 08:30:46 浏览:863
计算机同时输出和存储设备的区别 发布:2025-01-24 08:29:21 浏览:581
食物语上传 发布:2025-01-24 07:58:44 浏览:754
编程相关书籍 发布:2025-01-24 07:55:45 浏览:430
英雄联盟手游需要哪些配置 发布:2025-01-24 07:42:03 浏览:985
regex可以静态编译吗 发布:2025-01-24 07:40:32 浏览:79
怎么编译rec 发布:2025-01-24 07:39:04 浏览:56
卡片没加密 发布:2025-01-24 07:33:56 浏览:381
linux备份mysql 发布:2025-01-24 07:26:54 浏览:391
苹果手机忘记id密码怎么刷机 发布:2025-01-24 07:26:47 浏览:695