Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
brew httpd24和php70-php赢得';不渲染_Php_Macos_Apache_Laravel_Homebrew - Fatal编程技术网

brew httpd24和php70-php赢得';不渲染

brew httpd24和php70-php赢得';不渲染,php,macos,apache,laravel,homebrew,Php,Macos,Apache,Laravel,Homebrew,我正在尝试让httpd24和php70在brew中运行,以便在El Capitan上进行Laravel本地开发。大多数情况下,它是工作的,但PHP不会在索引加载时呈现。我在原生mac apache下运行了这个vhosts文件。我遇到的问题是如何将一个足够新的Tidy版本编译成PHP。我真的很喜欢用自制软件来管理这一切的概念,但我在执行上有问题 brew相关资料: $ brew doctor Your system is ready to brew. $ brew list apr

我正在尝试让httpd24和php70在brew中运行,以便在El Capitan上进行Laravel本地开发。大多数情况下,它是工作的,但PHP不会在索引加载时呈现。我在原生mac apache下运行了这个vhosts文件。我遇到的问题是如何将一个足够新的Tidy版本编译成PHP。我真的很喜欢用自制软件来管理这一切的概念,但我在执行上有问题

brew相关资料:

    $ brew doctor
Your system is ready to brew.
    $ brew list
apr     freetype    icu4c       nginx       openssl     readline
apr-util    gettext     jpeg        nmap        openssl@1.1 tidy-html5
bash-completion git     libpng      node        pcre        unixodbc
composer    htop        libxml2     nspr        php70       zlib
dnsmasq     httpd24     mysql       nss     php70-tidy
    $ brew services list
Name    Status  User Plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
httpd24 started root /Library/LaunchDaemons/homebrew.mxcl.httpd24.plist
mysql   started root /Library/LaunchDaemons/homebrew.mxcl.mysql.plist
我通过sudo运行上述所有服务,以使它们进入启动守护进程,否则apache将拒绝运行

我的vhosts文件如下:

<VirtualHost *:80>
   ServerAlias myuser-mn1.myco.biz
   ServerAlias laravel.localhost
   RewriteEngine On
   RewriteCond %{HTTPS} off
   RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:443>
   LogLevel debug
   UseCanonicalName Off
   ServerAlias myuser-mn1.myco.biz
   ServerAlias laravel.localhost
   AliasMatch ^/([a-zA-Z0-9_-]+)/?(.*)$ /Users/myuser/Code/projects/$1/public/$2
   AliasMatch ^/?$ /Users/myuser/Code/projects/index.php

   SSLEngine on
   SSLCertificateFile "/private/etc/apache2/ssl/server.crt"
   SSLCertificateKeyFile "/private/etc/apache2/ssl/server.key"

   DocumentRoot /Users/myuser/Code/projects
   DirectoryIndex index.html index.php

   <Directory /Users/myuser/Code/projects>
     Options FollowSymLinks Multiviews
     AllowOverride All
     Order allow,deny
     Allow from all
     Require all granted
   </Directory>
</VirtualHost>
所以,在这里,我可以在index.php上得到一个200,但它只是吐出了 谢谢你的建议


谢谢

在区分了/etc/apache2中的本机apache配置和/usr/local/etc/apache2/2.4下的brew apache配置之间的几乎每个文件之后,我发现brew apache2安装出于任何原因忽略了php的AddType指令:

<IfModule php7_module>
    AddType application/x-httpd-php .php

    DirectoryIndex index.html index.php
</IfModule>

AddType应用程序/x-httpd-php.php
DirectoryIndex.html index.php

在区分了/etc/apache2中的本机apache配置和/usr/local/etc/apache2/2.4下的brew apache配置之间的几乎每个文件后,我发现brew apache2安装出于任何原因忽略了php的AddType指令:

<IfModule php7_module>
    AddType application/x-httpd-php .php

    DirectoryIndex index.html index.php
</IfModule>

AddType应用程序/x-httpd-php.php
DirectoryIndex.html index.php