简体   繁体   English

如何将PHP应用程序部署为无需浏览到Phar的Phar

[英]How to deploy a php app as a phar w/out having to browse to the phar

I am interested in deploying my php (silex) based web as a phar. 我有兴趣将基于php(silex)的Web部署为Phar。 The app would be deployed on both macs and windows servers I don't control. 该应用程序将同时部署在我无法控制的Mac和Windows服务器上。 But I can require php5.3. 但是我可以要求php5.3。

if I access the phar ( http://server.com/myphar.phar ) directly in the browser it doesn't execute the php UNLESS you setup the web server to recognize phar files. 如果我直接在浏览器中访问phar( http://server.com/myphar.phar ),除非您将Web服务器设置为识别phar文件,否则它不会执行php。 At least that is what i think is happening. 至少那是我认为正在发生的事情。

How can I deploy my app as a Phar without requiring the users to access the phar directly in the browser? 如何在不要求用户直接在浏览器中访问phar的情况下将我的应用程序部署为Phar?

the answer appears to be "yes". 答案似乎是“是”。

I build everything Except index.php into the phar, and then simply do this in index.php 我将除index.php之外的所有内容都构建到了phar中,然后只需在index.php中进行此操作

<?php
include('myPhar.phar');

This seems to work so far. 到目前为止,这似乎可行。 It appears to function just as if there was no phar involved. 它似乎就像没有药一样起作用。

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

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