首页 > 编程知识 正文

和php安装出错相关的问题(和php安装出错相关的问题怎么解决)

时间:2023-12-24 12:05:58 阅读:321322 作者:OCAD

本文目录一览:

PHP安装出错

我怎么觉得你那两行是我机器上的配置,我的php、mysql、apache都是安装在e:的,而且都各自安装了多种版本。

你要找到你机器上的php5apache2_2.dll的位置,替换为指定的路径即可。

另外,你现在究竟遇到了什么问题,你说的没解决是什么意思???

PHP报这个错不用管,安装是算完成了的,只要手工修改httpd.conf后Apache就能正常工作,不工作你要说现象,最好拷贝个屏幕贴一下。

安装php软件时提示这样的错误:error trying access httpd.conf file,要求配置服务器,是什么意思?

不知道你怎么做的。我简单说下,php+Apache。

1.下载Apache和php,Apache是msi的,直接下一步下一步安装就好了。

安全完Apache,打开 ,成功的话可以看到 It works。

2.解压开php之后,打开Apache的配置文件 httpd.conf

2.1在LoadModule块结尾加上:

LoadModule php5_module D:/php5/php5apache2_2.dll

#假设你的php解压到了 D:/php5

2.2找到 DirectoryIndex 在后面加上 index.php,一般会让它放在第一个,这个引导页面是有顺序的,举例:

DirectoryIndex index.php index.html

2.3找到 mime_module 块 在里面结尾加上一句:

AddType application/x-httpd-php .php .phtml

#后缀名可以自己随便加,一般会用.php

2.4在文件的结尾 还可以加上一句:

PHPIniDir "D:/php5"

#这个是定义 php.ini 文件的。 如果没有这一句,Apache找不到php的配置,当然你可以把 php.ini 复制到C:/Windows 里面也可以,在环境变量的Path里加上 "D:/php5" 也是可以的。

3.去php目录,把 php.ini-production 或者 php.ini-development 复制一份,然后改名为 php.ini。进去编辑。加载自己需要的dll,还有ext的路径要设置一下,当然把 D:/php5/ext 写着环境变量的 Path也可以。

事实上没有第3步也可以运行php了,你可以去Apache设置的 DocumentRoot 下创建一个 index.php ,里面写着:

?php

phpinfo();

用 进去看看。

就可以查看到php的相关信息了。

php程序安装打开出现内容编码错误

亲,很高兴为你解答:

这可能是与服务器的全局配置有关:

1、服务器不支持这种压缩格式,可使用function_exists('ob_gzhandler')判断,解决方法 ob_start('ob_gzhandler')改为ob_start();

2、使用ob_start('ob_gzhandler')时候前面已经有内容输出,检查前面内容以及require include调用文件的内容。若无法找到可以在调用其它文件前使用ob_start(),调用之后使用 ob_end_clean () 来清除输出的内容;

也有可能是文件中包含了BOM头,你可以用以下程序检查:

?php

if (isset($_GET['dir'])){ //设置文件目录

$basedir=$_GET['dir'];

}else{

$basedir = '.';

}

$auto = 1;

checkdir($basedir);

function checkdir($basedir){

if ($dh = opendir($basedir)) {

  while (($file = readdir($dh)) !== false) {

   if ($file != '.'  $file != '..'){

    if (!is_dir($basedir."/".$file)) {

     echo "filename: $basedir/$file ".checkBOM("$basedir/$file")." br";

    }else{

     $dirname = $basedir."/".$file;

     checkdir($dirname);

    }

   }

  }

closedir($dh);

}

}

function checkBOM ($filename) {

global $auto;

$contents = file_get_contents($filename);

$charset[1] = substr($contents, 0, 1);

$charset[2] = substr($contents, 1, 1);

$charset[3] = substr($contents, 2, 1);

if (ord($charset[1]) == 239  ord($charset[2]) == 187  ord($charset[3]) == 191) {

  if ($auto == 1) {

   $rest = substr($contents, 3);

   rewrite ($filename, $rest);

   return ("font color=redBOM found, automatically removed./font");

  } else {

   return ("font color=redBOM found./font");

  }

}

else return ("BOM Not Found.");

}

function rewrite ($filename, $data) {

$filenum = fopen($filename, "w");

flock($filenum, LOCK_EX);

fwrite($filenum, $data);

fclose($filenum);

}

?

运行后看一下程序输出就可以了,有BOM头的会有红字提示。

-----------------------------------

如有疑问欢迎追问!

满意请点击右上方【选为满意回答】按钮 么么哒o(∩_∩)o

linux 下安装完php出现错误

这个不是报错。查看版本命令你少了一个空格,要在php后面加个空格

编译安装php时出错configure: error: build test failed.

对于PHP在./configure的时候出现下面问题:

checking whether to enable LIBXML support... yes

checking libxml2 install dir... /usr/local/libxml2/

checking for xml2-config path... /usr/local/libxml2//bin/xml2-config

checking whether libxml build works... no

configure: error: build test failed. Please check the config.log for details.

#按照提示我们查看php安装目录下的config.log文件,搜索xml2-config

[root@lamp-lnmp php-5.6.40]# vim config.log

#发现下面内容:

configure:23104: checking for xml2-config path

configure:23118: result: /usr/local/libxml2//bin/xml2-config

configure:23262: checking whether libxml build works

configure:23289: cc -o conftest -g -O2 -fvisibility=hidden -pthread -D_REENTRANT -Wl,-rpath,/usr/local/libxml2/lib -L/usr/local/libxml2/lib conftest.c

-lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl 5

configure:23289: $? = 0

configure:23289: ./conftest

./conftest: /lib64/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/local/libxml2/lib/libxml2.so.2)

configure:23289: $? = 1

configure: program exited with status 1

configure: failed program was:

#我们这里查看一下这个/lib64/libz.so.1的文件,发现链接到一个旧的libz文件中,这里将/lib64/libz.so.1软连接到新文件/usr/local/lib/libz.so.1.2.11中进行下面设置。

[root@lamp-lnmp ~]# ln -sf /usr/local/lib/libz.so.1.2.11 /lib64/libz.so.1

[root@lamp-lnmp ~]# ls -l /lib64/libz.so.1

lrwxrwxrwx 1 root root 29 Feb 2 11:13 /lib64/libz.so.1 - /usr/local/lib/libz.so.1.2.11

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。