linux lamp结构 编译与安装遇到的问题

本文发布时间: 2019-Mar-22
mysql 这里就不做编译了。可以自己到官方下载试试 sudo apt-get install mysql-server-5.1 mysql-client-5.1 sudo apt-get install libmysqlclient16 libmysqlclient16-dev -y[root@brain test] wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.3.tar.gz[root@brain test] tar -zxvf httpd-2.4.3.tar.gz[root@brain test] mv httpd-2.4.3 httpd./configure -prefix=/usr/local/apache2 -enable-module=so -enable-rewrite=shared -enable-authn-dbm编译Apache出现问题:configure: error: APR not found . Please read the documentation好艰巨的任务来了1.下载所需软件包:wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gzwget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gzwget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip2.编译安装:yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs具体步骤如下: a:解决apr not found问题>>>>>>[root@brain test]# tar -zxf apr-1.4.5.tar.gz[root@brain test]# cd apr-1.4.5[root@brain apr-1.4.5]# ./configure --prefix=/usr/local/aprTNND 发现有出问题了Could not compile libxml2: /bin/rm: cannot remove `libtoolT': No such file or directory[root@brain apr-1.4.5]# apt-get install libtool重新编译 ok..[root@brain apr-1.4.5]# make && make installb:解决APR-util not found问题>>>>[root@brain test]# tar -zxf apr-util-1.3.12.tar.gz[root@brain test]# cd apr-util-1.3.12[root@brain apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util --with- apr=/usr/local/apr/bin/apr-1-config[root@brain apr-util-1.3.12]# make && make installc:解决pcre问题>>>>>>>>>[root@brain test]#unzip -o pcre-8.10.zip[root@brain test]#cd pcre-8.10[root@brain pcre-8.10]#./configure --prefix=/usr/local/pcre[root@brain pcre-8.10]#make && make install好了,这里三个问题基本解决了退回到 httpd目录重新编译./configure -prefix=/usr/local/apache2 -enable-module=so -enable-rewrite=shared -enable-authn-dbm --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcreok 了make && make install下面这段密集的文字是我网上找的安装PHP 步步和安装apache差不多。tar zxvf /root/载下/php-5.3.10.tar.gz -C /usr/src/php5//压压解文件 cd /usr/src/php5/php-5.3.10//进压压录入解后的目 编编先一下:./configure -prefix=/usr/local/php5//php录安装目 -with-apxs2=/usr/local/apache2/bin/apxs//这个貌似很重要,但是具体作用我不是很清楚(囧)-with-mysql=/usr/local/mysql//这个是mysql录的安装目,如果不知道在哪里,就再终栏端入:find / -name mysql.h 这录就是个文件所在的目。如果没有装mysql-client话的就会找不到mysql.h的。-with-mysqli=/usr/local/mysql/bin/mysql_config//这个是config_config所录在的目,如果不知道在哪里,就用:find / -name mysql_config 如果没有装mysql_client话这的也是找不到个文件的。 -with-libxml-dir //开开打libxml2库的支持 -with-gd//开开打gd库的支持 这开个一般都是要的 -with-pear//开打pear命令的支持,php扩展用的 请关其他更多的参数及作用网上参考相文件。然后make,之后再make install编编过过问问,如果通那基本上安装程就没。动然后启php,直接运行/usr/local/php5/bin/php文件开打/usr/local/apache2/conf/httpd.conf文件,找到AddType application/x-gzip .gz .tgz 这一行,这然后在一行下面添加两行: AddType application/x-httd-php .phpAddType application/x-httpd-php-source .phps 保存推出,重启apache:/usr/local/apache2/bin/apachectlrestart 然后找到/usr/local/apache2/htdocs夹这文件,个是apache认录这的默根目,再里面新建一个index.php文件:<?php echo phpinfo();?>开开栏栏然后再器地址入:loaclhost/index.php显则测测库连如果能正常示,配置成功。然后自己再下数据是否能通好吧 ,上面的完了下面的问题来了。什么缺少 mysql header 各种问题来了。./configure -prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/include/mysql/--with-mysqli=/usr/bin/mysql_config –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr–enable-xml –disable-rpath –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization–with-curl –with-curlwrappers –enable-mbregex –enable-fpm –enable-mbstring –with-mcrypt –with-gd –enable-gd-native-ttf–with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/bin/mysql_config --enable-fpm --with-mysql=/usr/lib/mysql --with-mysqli --with-libxml-dir --with-gd --with-pear --with-gz --with-openssl--with-jpeg-dir=/usr/local –-with-curl –-with-curlwrappers –enable-mbregex –enable-fpm –enable-mbstring –-with-mcrypt –enable-gd-native-ttferror update./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/bin/mysql_config --enable-fpm --with-mysql=/usr --with-mysqli --with-libxml-dir --with-gd --with-pear --with-gd --with-opensslokroot@MyVPS:/soft/php-5.4.6# find /usr -name "mysql" -type d -print/usr/lib/perl5/auto/DBD/mysql/usr/lib/perl5/DBD/mysql/usr/lib/mysql/usr/include/mysql/usr/share/mysqlcp php.ini-development /usr/dev/php5.3.6/lib/php.ini编辑 httpd.conf 文件以调用 PHP 模块。LoadModule 表达式右边的路径必须指向 系统中的 PHP。以上的 make install 命令可能已经完成了这些,但务必要检查。LoadModule php5_module modules/libphp5.so告知 Apache 将特定的扩展名解析成 PHP,例如,让 Apache 将扩展名 .php 解析成 PHP。为了避免潜在的危险,例如上传或者创建类似exploit.php.jpg的文件并被当做 PHP 执行,我们不再使用 Apache 的 AddType 指令来设置。参考下面的例子,你可以简单的将需要的扩展名解释为 PHP。我们演示为增加.php。<FilesMatch "\.php$"> SetHandler application/x-httpd-php</FilesMatch>


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:11pm
栏目列表