简体   繁体   English

如何在xampp等网络服务器上部署phar文件

[英]how to deploy phar file on a webserver like xampp

I am using maven with php and packaging my code to phar archive and deploy it on xampp. 我正在使用带有php的maven并将我的代码打包到phar存档并将其部署在xampp上。 In java we copy war files for webapp folder of application server like tomcat. 在java中,我们为tomcat等应用服务器的webapp文件夹复制war文件。 How do I do that in php? 我怎么在PHP中这样做? do i just go and put the .phar in xampp/htdocs folder ? 我只是把.phar放在xampp / htdocs文件夹中?

Thanks 谢谢

You need to tell Apache that it should run .phar files with PHP: 您需要告诉Apache它应该使用PHP运行.phar文件:

cat /etc/apache2/mods-enabled/php5.conf |head -n3
<IfModule mod_php5.c>
    <FilesMatch "\.ph(ar|p3?|tml)$">
      SetHandler application/x-httpd-php

See http://cweiske.de/tagebuch/phar-webserver.htm for more details. 有关详细信息,请参阅http://cweiske.de/tagebuch/phar-webserver.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM