Bug #60351 [Com]: Phar::createDefaultStub runs indexfile, not webindexfile parameter

From: Date: Mon, 28 Nov 2011 17:39:42 +0000
Subject: Bug #60351 [Com]: Phar::createDefaultStub runs indexfile, not webindexfile parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-165536@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60351&edit=1 ID: 60351 Comment by: reeze dot xia at gmail dot com Reported by: scott at aubrey dot org dot uk Summary: Phar::createDefaultStub runs indexfile, not webindexfile parameter Status: Open Type: Bug Package: Built-in web server Operating System: Mac OS X Lion 10.7.2 PHP Version: 5.4.0RC1 Block user comment: N Private report: N New Comment: Hi, scott: 1. How can you run .phar file in builtin web server? The server seems can only serve .php file as script file. do you mean rename the .phar file to php ? 2. After rename the phar file to php doesn't reproduce the wrong error output. Could you please post more details about the bug ? thx :) Previous Comments: ------------------------------------------------------------------------ [2011-11-21 20:32:20] scott at aubrey dot org dot uk Description: ------------ When building a phar, you can use a default stub creator by using Phar::createDefaultStub. The first param should run from the CLI, the second from a web server. When using the built in CLI-web server and navigating to the phar, the file in the first param is run. When testing on apache the same file, it runs the second param. Test script: --------------- <?php $testPhar = new Phar('test.phar',null, 'test'); $testPhar->addFromString('cli.php', '<?php print "CLI".PHP_EOL;exit;'); $testPhar->addFromString('web.php', '<?php print "web".PHP_EOL;exit;'); $testPhar->setStub($testPhar->createDefaultStub('cli.php','web.php')); Expected result: ---------------- browser should simple output "web" Actual result: -------------- browser shows "CLI" when run from CLI web server ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60351&edit=1

« previous php.bugs (#165536) next »