<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>51192</bug_id>
          
          <creation_ts>2024-08-19 11:09:28 +0300</creation_ts>
          <short_desc>Не отображаются файлы профиля в веб-интерфейсе</short_desc>
          <delta_ts>2024-08-19 11:09:28 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>webgrind</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Владислав Елисеев">eliseevva</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          <cc>lav</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>250207</commentid>
    <comment_count>0</comment_count>
    <who name="Владислав Елисеев">eliseevva</who>
    <bug_when>2024-08-19 11:09:28 +0300</bug_when>
    <thetext>Версия пакета:
webgrind-1.9.3-alt1
Платформа:
Alt Workstation 10.2 обновленная до Sisyphus
Шаги к воспроизведению:
1) # apt-get install php8.2 php8.2-xdebug php8.2-fpm-fcgi  webgrind apache2-mod_php8.2

Настроить webgrind:
Редактируем конфигурацию apache в файле /etc/httpd2/conf/sites-enabled/000-default.conf:

```

    DocumentRoot &quot;/var/www/webapps&quot;

```

В этом же файле редактируем:

```

    &lt;Directory &quot;/var/www/webapps&quot;&gt;
               # Summary: Configure for html documents in DocumentRoot
               # Requires: Directory-html
               Include conf/include/Directory_html_default.conf
               Require all granted
       &lt;/Directory&gt;

```
Чтобы исправить ошибку https://bugzilla.altlinux.org/51191 нужно выделить нужные права
# chmod -R 775 /var/www/webapps/webgrind
# chown -R apache2:apache2 /var/www/webapps/webgrind
# systemctl start httpd2.service php8.2-fpm.service

# vim /etc/php/8.2/cli/php.ini

Добавить в файл:
[xdebug]
xdebug.mode = profile
xdebug.output_dir = &quot;/&quot;
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1

# vim /var/www/webapps/webgrind/config.php

Поменять значение строк:

static $storageDir = &apos;/var/www/webapps/webgrind&apos;;
static $profilerDir = &apos;/&apos;
static $pythonExecutable = &apos;/usr/bin/python3&apos;;


# mkdir /var/tmp/xdebug &amp;&amp; chown apache2:apache2 /var/tmp/xdebug &amp;&amp; chmod 775 /var/tmp/xdebug
2) # echo &apos;&lt;?php
function slowFunction() {
   usleep(500000); // Пауза в полсекунды
}
function anotherFunction() {
   for ($i = 0;$i &lt; 10; $i++) {
       slowFunction();
   }
}
anotherFunction();
?&gt;&apos; &gt; /tmp/test.php &amp;&amp; php /tmp/test.php
Зайти на веб-страницу http://localhost/webgrind и нажать кнопку update
Ожидаемый результат: Отображение файла профилей
Реальный результат: Главная страница Webgrind остается и ничего не меняется
Логи при нажатии на кнопку:
[Mon Aug 19 11:05:21.090593 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP Warning:  Undefined array key 0 in /var/www/webapps/webgrind/index.php on line 41, referer: http://10.88.14.19/webgrind/
[Mon Aug 19 11:05:21.090638 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP Stack trace:, referer: http://10.88.14.19/webgrind/
[Mon Aug 19 11:05:21.090649 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP   1. {main}() /var/www/webapps/webgrind/index.php:0, referer: http://10.88.14.19/webgrind/
[Mon Aug 19 11:05:21.090661 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP Warning:  Trying to access array offset on value of type null in /var/www/webapps/webgrind/index.php on line 41, referer: http://10.88.14.19/webgrind/
[Mon Aug 19 11:05:21.090669 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP Stack trace:, referer: http://10.88.14.19/webgrind/
[Mon Aug 19 11:05:21.090676 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP   1. {main}() /var/www/webapps/webgrind/index.php:0, referer: http://10.88.14.19/webgrind/
[Mon Aug 19 11:05:21.091026 2024] [php:notice] [pid 17328:tid 17328] [client 10.64.131.9:56866] PHP Fatal error:  Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /var/www/webapps/webgrind/library/Reader.php:255\nStack trace:\n#0 /var/www/webapps/webgrind/library/Reader.php(255): fread(Resource id #12, 0)\n#1 /var/www/webapps/webgrind/library/Reader.php(91): Webgrind_Reader-&gt;read(0)\n#2 /var/www/webapps/webgrind/library/Reader.php(76): Webgrind_Reader-&gt;init()\n#3 /var/www/webapps/webgrind/library/FileHandler.php(169): Webgrind_Reader-&gt;__construct(&apos;/var/www/webapp...&apos;, &apos;percent&apos;)\n#4 /var/www/webapps/webgrind/index.php(43): Webgrind_FileHandler-&gt;getTraceReader(NULL, &apos;percent&apos;)\n#5 {main}\n  thrown in /var/www/webapps/webgrind/library/Reader.php on line 255, referer: http://10.88.14.19/webgrind/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>