Jump to content

rick645

Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by rick645

  1. $ cat docker-compose.yml version: '2' services: php: image: yiisoftware/yii2-php:7.4-apache volumes: - ~/.composer-docker/cache:/root/.composer/cache:delegated - ./:/app:delegated ports: - '8000:80' $ docker-compose up -d Starting yii_php_1 ... done $ curl http://localhost:8000/ <br /> <b>Fatal error</b>: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.33. in <b>/app/vendor/composer/platform_check.php</b> on line <b>24</b><br /> ????
  2. Thanks for the info
  3. That's not the point. The point is, because error_reporting = E_ALL & ~E_WARNING & ~E_USER_WARNING doesn't work.
  4. $ cat entry-point.php <?php var_dump(ini_get('error_reporting')); class C { final private function m() {} } $ cat php.ini error_reporting = E_ALL & ~E_WARNING & ~E_USER_WARNING $ php entry-point.php PHP Warning: Private methods cannot be final as they are never overridden by other classes in /tmp//entry-point.php on line 4 string(5) "22527" Comprehensible!!! $ php -c php.ini entry-point.php Warning: Private methods cannot be final as they are never overridden by other classes in /tmp//entry-point.php on line 4 string(5) "32253" Now I do not understand...
  5. $ php -v PHP 8.1.2-1ubuntu2.10 (cli) (built: Jan 16 2023 15:19:49) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2-1ubuntu2.10, Copyright (c), by Zend Technologies $ cat entry-point.php <?php error_reporting(E_ALL & ~E_WARNING & ~E_USER_WARNING); class C { final private function m() {} } $ php entry-point.php PHP Warning: Private methods cannot be final as they are never overridden by other classes in /tmp//entry-point.php on line 6 Ok, the appropriate WARNING appears. However, since there is error_reporting(...) instruction, it should not appear. Why do you appear?
  6. $ chown www-data:www-data /var/log/error.log Solved!!!
  7. $ cat master/.htaccess RewriteEngine On RewriteRule ^(.*)$ src/index-debug.php [L] $ cat docker-compose.yml services: web: build: . ports: - 8014:80 volumes: - .:/var/www/html - ./docker/volumes/etc/php.ini:/usr/local/etc/php/php.ini $ cat Dockerfile FROM php:apache RUN a2enmod rewrite $ cat master/src/index-debug.php <?php error_log("error message 123"); var_dump( ini_get('error_log'), ini_get('log_errors'), file_get_contents('/var/log/error.log'), ); $ cat docker/volumes/etc/php.ini log_errors = On error_log = /var/log/error.log $ docker-compose up -d WARNING: Found orphan containers (xxx) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. Starting xxx... done $ curl http://localhost:8014/master/src/index-debug.php string(18) "/var/log/error.log" string(1) "1" <b>Warning</b>: file_get_contents(/var/log/error.log): Failed to open stream: No such file or directory in <b>/var/www/html/master/src/index-debug.php</b> on line <b>4</b><br /> bool(false) Why?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.