zendtech / ZendOptimizerPlus

Other
914 stars 142 forks source link

A command execution issue from CGI #159

Closed hidenori-wasa closed 10 years ago

hidenori-wasa commented 10 years ago

I wanted to get pear directory, but a deprecated prefix was added in case of first time.

The "php.ini" setting.

[Zend OPcache]
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 8
opcache.max_accelerated_files = 4000
opcache.fast_shutdown = 1
; Constant Value: 0         We cannot call command to get result from CGI because a deprecated prefix was added in case of first time.
opcache.enable_cli = 1
; Constant Value: 1         Because we must cache modified "*.php" files.
opcache.validate_timestamps = 1
; Development Value: 0      Because we must cache modified "*.php" files.
; Production Value: 2       Because production server want to modify a file during execution.
opcache.file_update_protection = 0
; Development Value: 0      Because we must cache modified "*.php" files.
; Production Value: 60      Because production server does not want to access a file as much as possible.
opcache.revalidate_freq = 0

The issue code.

<?php

// Gets pear directory.
exit('<pre>' . `pear config-get php_dir` . '</pre>');

?>

Its second result.

C:\xampp\php\pear

Its first result.

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Frontend.php on line 90

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 645

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 694

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 761

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 788

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 919

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 1559

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 1586

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 2086

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 2099

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Config.php on line 2155

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Registry.php on line 294

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0
    0.0383     401112   2. require_once('C:\xampp\php\PEAR\PEAR\Config.php') C:\xampp\php\PEAR\pearcmd.php:54

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Registry.php on line 1340

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0
    0.0383     401112   2. require_once('C:\xampp\php\PEAR\PEAR\Config.php') C:\xampp\php\PEAR\pearcmd.php:54

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Registry.php on line 1346

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0
    0.0383     401112   2. require_once('C:\xampp\php\PEAR\PEAR\Config.php') C:\xampp\php\PEAR\pearcmd.php:54

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Command.php on line 143

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Command.php on line 160

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR\Command\Config.php on line 346

Call Stack:
    0.0050     367440   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0
    0.2167     532368   2. PEAR_Command::factory() C:\xampp\php\PEAR\pearcmd.php:275

C:\xampp\php\pear

I want to delete a deprecated prefix. However, it is correct when "php.ini" setting is "opcache.enable_cli = 0".

TerryE commented 10 years ago

@hidenori-wasa, I can't replicate this with the current php 5.4, 5.5 or 5.6-dev on my LAMP stacks, but I see that you are using a Win32 XAMP config, so (i) what versions are you using: WinXX, php, ZendOpcache? Are you also loading xdebug?

hidenori-wasa commented 10 years ago

The using versions:

Default php version is "5.3.8", but I compiled because "XAMPP1.7.7" did slowdown in case of unit test step execution. But, didn't improve even if I change "php5.3.8" to "php5.3.1". Perhaps, it may be difference of "php5.3.1" which was compiled with "VC++6.0" and "php5.3.8" which was compiled with "VC++9.0".

dstogov commented 10 years ago

Thanks for report. This is a known problem, duplicate of issue #18 Unfortunately, we don't know a good way to fix it. I'm closing this issue, but #18 is still open.