简体   繁体   中英

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. The app would be deployed on both macs and windows servers I don't control. But I can require 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. 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?

the answer appears to be "yes".

I build everything Except index.php into the phar, and then simply do this in index.php

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

This seems to work so far. It appears to function just as if there was no phar involved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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