php安装完后 apache the requested has,apache-the requested has failed解决方法(待补充)

apache--the requested has failed解决办法(待补充)

安装好apache+mysql+php5后,配置apache服务器中的httpd配置文件后就无法启动Apache了,出现了如标题的情况,在网上搜了一下,很大一部分原因可能是配置文件出现了问题。运行cmd,用命令启动Apache,

apache会提示你哪句有误,然后就可以针对性的解决,进入\Apache2.2\bin\后,命令如下: httpd.exe

遇到的为题:

问题1:

“Apache is running a threaded MPM,but your PHP Modle is not compiled to be threadsafe. You need to recompile PHP.”

分析:

PHP编译模式错了。如果在windows下,需在php.net上下载 PHP 5.2.13 zip package ,不要下debug pakage 或 Non-thread-safe zip package.

Windows binary of mod_fcgid is at www.apachelounge.com/download/

httpd文件配置 一览:(只提取了其中有效的指令,需要配置的地方,待补充)

ServerRoot "E:/Web/Apache2.2"     //服务器运行根目录

Listen 82   //设置端口号

LoadModule actions_module modules/mod_actions.so

LoadModule alias_module modules/mod_alias.so

LoadModule asis_module modules/mod_asis.so

LoadModule auth_basic_module modules/mod_auth_basic.so

LoadModule authn_default_module modules/mod_authn_default.so

LoadModule authn_file_module modules/mod_authn_file.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so

LoadModule authz_host_module modules/mod_authz_host.so

LoadModule authz_user_module modules/mod_authz_user.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule cgi_module modules/mod_cgi.so

LoadModule dir_module modules/mod_dir.so

LoadModule env_module modules/mod_env.so

LoadModule include_module modules/mod_include.so

LoadModule isapi_module modules/mod_isapi.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule mime_module modules/mod_mime.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule php5_module E:/Web/php5/php5apache2_2.dll    //需要添加的部分,该句经常报问题1中的错误

ServerAdmin hu_hu_hi@126.com // ServerAdmin:你的邮件地址,当发生问题时Apache将

向你发出邮件。

DocumentRoot "E:/Web/Apache2.2/htdocs"      //存放项目的地址,课修改

//修改了上面的路径后,这一行路径也得改

DirectoryIndex index.html index.php //添加一个php默认页

ErrorLog "logs/error.log" //错误日志文件定位

LogLevel warn//控制记录在错误日志文件中的日志信息数量。

CustomLog "logs/access.log" common//指定接入日志文件的定位和格式

ScriptAlias /cgi-bin/ "E:/Web/Apache2.2/cgi-bin/" 指定包含服务脚本的目录。

AllowOverride None

Options None

Order allow,deny

Allow from all

AddType application/x-httpd-php .php //添加希望Apache服务器能够识别的PHP扩展名

DefaultType text/plain

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

使用组合包快速安装

组合包就是将Apache、php、MySQL等服务器软件和工具,安装配置完成后进行打包处理。只需要将已配置的套件解压到本地硬盘中即可使用,无需再另行配置。组合包的优点是安装简单,无需另行配置,速度较快而且运行稳定,但缺点是灵活性较差。初学者可以选择此安装方法。

推荐使用Appserv、EasyPHP、XAMPP,它们都是Apache+php+MySQL开发环境,其中XAMPP相对复杂一些,不仅可以切换PHP4和PHP5,还集成了perl开发环境、第三方扩展库等,并且对开发平台进行了优化和整理。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ValueError: setting an array element with a sequence. The requested array has anhomogeneous shape after 1 dimensions. The detected shape was (14,) + inhomogeneous part. This error occurs when you try to assign a sequence (such as a list) to an element of a NumPy array, but the array has an inhomogeneous shape. To resolve this issue, you can follow these steps: 1. Check the shape of your array: First, check the shape of your array using the `shape` attribute. This will help you understand the dimensions and sizes of your array. 2. Ensure consistent shape: Make sure that all the elements in your array have the same shape. If there are elements with different shapes, you will encounter this error. You can use the `np.shape()` function to check the shape of each element in the array and ensure they are consistent. 3. Convert elements to the same shape: If you find elements with different shapes, you can convert them to the same shape using the `np.reshape()` function. This function allows you to reshape the elements to a desired shape. Here's an example that demonstrates how to fix this error: ```python import numpy as np # Create an array with inconsistent shape arr = np.array([(1, 2), [3, 4, 5], (6, 7, 8, 9)]) # Check the shape of the array print(arr.shape) # Output: (3,) # Reshape the elements to the same shape arr = np.array([np.reshape(x, (3,)) for x in arr]) # Check the shape of the array again print(arr.shape) # Output: (3, 3) ``` By reshaping the elements to the same shape, you can avoid the ValueError and ensure that the array has a homogeneous shape.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值