php-fpm request hangs after producing output and PHP finishes

Instana trace of the problem:
Instana trace showing the problem

The problem: randomly, some requests take an extra 20 to 60s to finish compared to normal.

Manually running CURL shows the following behaviour:

  • curl example.com/api
  • 2 seconds – no output nothing happens (I expect this to be PHP processing time)
  • 0.5-1 seconds – lots of JSON output and then it suddenly stops randomly, like in the middle div class="aa
  • 20+ seconds – no output
  • the last second – the remaining 1-2 lines of the request output are displayed
  • request finishes

I expect to not have the 20+ seconds delay where nothing happens.

Captured tcpdump of the communication

Infrastructure

tcpdump of the nginx <-> php-from communication

To note that the lat FCGI_STDOUT packet is delayed by 50+ seconds, and it contains a few bytes(in this case the json closing tags “]}}” ):

FastCGI (FCGI_STDOUT)
Version: 1
Type: FCGI_STDOUT (6)
Request ID: 1
Content Length: 6
Padding Length: 2
Content Data: 5c6e225d5d7d
Padding Data: 0000

FastCGI (FCGI_STDOUT)
Version: 1
Type: FCGI_STDOUT (6)
Request ID: 1
Content Length: 6
Padding Length: 2
Content Data: 5c6e225d5d7d
Padding Data: 0000

My php-fpm settings:

# php-fpm -v
PHP 7.4.28 (fpm-fcgi) (built: Mar 29 2022 03:26:54)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies


[www]
user = www-data
group = www-data
listen.owner = www-data
listen.group = www-data
listen = 0.0.0.0:9000
listen.backlog = 1024
process.priority = 0
pm = dynamic
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.process_idle_timeout = 55
pm.max_children = 100
pm.start_servers = 10
pm.max_requests = 10000
slowlog = /var/log/php-fpm/slowlog.log
request_slowlog_timeout = 10
request_terminate_timeout = 600
user = www-data
catch_workers_output = yes
security.limit_extensions = .php .phar
pm.status_path = /status
php_admin_value[memory_limit] = 512M
php_admin_value[post_max_size] = 256M
php_admin_value[upload_max_filesize] = 256M
php_admin_value[max_execution_time] = 60
php_admin_value[opcache.revalidate_freq] = 0
php_admin_value[opcache.validate_timestamps] = 0
php_admin_value[opcache.max_accelerated_files] = 32531
php_admin_value[opcache.memory_consumption] = 512M
php_admin_value[opcache.interned_strings_buffer] = 128
php_admin_value[opcache.huge_code_pages] = 0
php_admin_value[zend.assertions] = 0
php_admin_value[max_input_vars] = 2000

My nginx settings:

# nginx -v
nginx version: nginx/1.20.1


upstream php {
server 127.0.0.1:9000;
}

server_tokens off;
server_names_hash_bucket_size 256;
client_max_body_size 256m;

server {
listen 80;
server_name xxx;

root /usr/share/xxx/public_api;
index index.php;
try_files $uri $uri/ /index.php?$args;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

client_header_timeout 120;
client_body_timeout 120;
send_timeout 120;
keepalive_timeout 60;

gzip on;
gzip_comp_level 4;
gzip_proxied any;
gzip_types application/atom+xml application/javascript application/json application/rss+xml
application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json
application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css
text/plain text/x-component;

location ~ .php$ {
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 120s;
fastcgi_send_timeout 120s;

fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

fastcgi_param APPLICATION_ENV live;
fastcgi_param HTTPS off;

opentracing_fastcgi_propagate_context;
}
}

Combine array values with specific key has same value

I have the following array:

[
    {
       amendment: 1,
       lcnumber: "A1114564564CT",
       31D: "New Note"
    },
   {
      27: "0/0 (Number)(Total)",
      amendment: 1,
      lcnumber: "A1114564564CT",
   },
   {
      amendment: 2,
      lcnumber: "A1114564564CT",
      31D: "IN SINGAPORE (120 Days from L/C issue date)",
      32B: "USD"
   },
   {
     27: "2/2 (Number)(Total)",
     amendment: 2,
     lcnumber: "A1114564564CT",
     39B: "Exceeding"
   }
  ]

What I’m trying to do, is to combine the values into one index with the same amendment count

This is my expected output

 [
    {
       amendment: 1,
       lcnumber: "A1114564564CT",
       31D: "New Note",
       27: "0/0 (Number)(Total)",
    },
   {
      amendment: 2,
      lcnumber: "A1114564564CT",
      31D: "IN SINGAPORE (120 Days from L/C issue date)",
      32B: "USD",
      27: "2/2 (Number)(Total)",
      39B: "Exceeding"
   },
  ]

I’ve tried writing a foreach loop but this didn’t work

foreach($final_datas as $arrflight) {
    $final_array[] = (object) array(
        'lcnumber' => 'AZ300',
        $arrflight['swift_code'] => $arrflight['note']
    ); 
}

code for searching the query in such a way that it should search the keyword from both table1 &2 in which the table 1

I have a database which has 2 tables in table1 there is data of around 5000 rows and in this cid is the primary key and in table2 there are the alternate names of the names which is in table1.

now what I want to do is whenever someone searches a keyword it should go and check both the tables and then display the only when they have the same cid. and the table2 has many entries and though the cid is in repetition.

can someone give me a suitable solution for the same.I really need the help and that too urgent..

Will a query string appended to url which mod rewritten work

I have a dynamic page which I used mod rewrite to make the url friendly:

RewriteRule ^page/([0-9]+)/([A-Za-z0-9-_.]+)?/?$ /page.php?id=$1&slug=$2 [NC,L]

Now there are other parameter I want to add to the url for some of the pages, I tried it but was not identified in php $_GET. So I want to know if there is a way to that beside adding it in the rewrite rule.

Arrows staying above text

I am trying to place a new text section below an existing image section (4 arrows) but because of its position (I think, I’m not sure), the arrows are above the text.

Perhaps this is happening because of style inheritance ?

badly placed

The arrows section :

<section>
        <div class="container">
            <h4 class="blue bold mb-4 mt-3">{{ __('front.homepage.best-sales') }}</h4>

            <div class="row relative">
              <div class="arrowContentLeft arrowContentLeft-1">
                <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
              </div>
              <div class="arrowContentRight arrowContentRight-1">
                <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
              </div>
                <div class="col-lg-12 col-11 mx-auto carousel-categories">
                    @foreach($bestSellers as $bestSeller)
                        <x-product :activity="$bestSeller"/>
                    @endforeach
                </div>

                @if($bestSellers->count() < 1)
                    <div>{{ __('front.activities.not-found') }}</div>
                @endif
            </div>

            <h4 class="blue bold mb-4 mt-3">{{ __('front.homepage.best-reviews') }}</h4>

            <div class="row relative">
              <div class="arrowContentLeft arrowContentLeft-2">
                <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
              </div>
              <div class="arrowContentRight arrowContentRight-2">
                <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
              </div>

                <div class="col-lg-12 col-11 mx-auto carousel-categories-2">
                    @foreach($bestReviews as $bestReview)
                        <x-product :activity="$bestReview"/>
                    @endforeach
                </div>

                @if($bestReviews->count() < 1)
                    <div>{{ __('front.activities.not-found') }}</div>
                @endif
            </div>

            @if ($videos)
              <h4 class="blue bold mb-4 mt-5">Des vidéos de {{ $localisation['name'] }}</h4>

              <div class="row relative rowVideo">
                  @if(count($videos) > 5)
                    <div class="arrowContentLeft arrowContentLeft-3">
                      <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
                    </div>
                    <div class="arrowContentRight arrowContentRight-3">
                      <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
                    </div>
                  @endif
                      <div class="col-lg-12 col-11 mx-auto carousel-video">
                        @foreach ($videos as $video)
                          <div class="containerVideo">
                            <div class="headerVideo">
                              <div class="backgroundBlur">
                                <div class="playButton">
                                  <img src="{{ asset('img/play-button-arrowhead.png') }}" alt="play button">
                                </div>
                              </div>
                                <video
                                  class="video-js"
                                  controls
                                  preload="auto"
                                  data-setup="{}"
                              >
                                  <source src="{{ $video->url }}" type="video/mp4" />
                        {{--           <source src="{{ asset('/video/inscription-vantage.mov') }}" type="video/mov" />
                                  <source src="{{ asset('/video/inscription-vantage.ogg') }}" type="video/ogg" />
                                  <source src="{{ asset('/video/inscription-vantage.webm') }}" type="video/webm" /> --}}
                                  <p class="vjs-no-js">
                                      To view this video please enable JavaScript, and consider upgrading to a
                                      web browser that
                                      <a href="https://videojs.com/html5-video-support/" target="_blank"
                                      >supports HTML5 video</a
                                      >
                                  </p>
                              </video>
                            </div>
                            <div class="descVideo">{{ $video->title }}</div>
                          </div>
                        @endforeach
                    </div>

                  @if($bestSellers->count() < 1)
                    <div>{{ __('front.activities.not-found') }}</div>
                @endif
            </div>
            @endif

            @if($blogs->count() > 0)

                <h4 class="blue bold mb-4 mt-5">À propos de {{ $localisation['name'] }}</h4>

                <div class="row relative rowInfo">
                    @if($blogs->count() > 3)
                  <div class="arrowContentLeft arrowContentLeft-4">
                    <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
                  </div>
                  <div class="arrowContentRight arrowContentRight-4">
                    <img class="arrowCarou" src="{{ asset('img/left-arrow.png') }}" alt="left arrow">
                  </div>
                    @endif
                  <div class="col-lg-12 col-11 mx-auto carousel-info">

                    @foreach($blogs as $blog)
                      <div class="containerInfo">
                        <div class="headerInfo">
                          <div class="price-tag black">
                            <p>
                              <a class="text-decoration-none" href="{{ route('blog.index', ['slug_category' => $blog->category]) }}" style="color: white;">
                                {{ $blog->category }}
                              </a>
                            </p>
                          </div>
                          <div class="price_tag_color" style="background-color: {{ $activity->mainTheme->color ?? '' }};"></div>
                          <div class="backgroundBlur"></div>
                          <div class="imgInfo">
                            <img src="{{ $blog->image->small_size ?? null }}" alt="lyon" style="width: 100%">
                          </div>
                        </div>
                        <div class="descInfo">
                          <h4 class="card-title" style="color: #000002; background: none; margin-top: 10px">
                            <a href="{{ route('blog.show', ['slug_category' => $blog->slug_category, 'id' => $blog->id, 'url' => $blog->url]) }}"  style="color: #000002; background: none; margin-top: 10px">
                                {{ $blog->title }}
                            </a>
                          </h4>
                          <div class="card-text clear-black">
                            @if($blog->description)
                                {{ $blog->description }}
                            @else
                                {{ IlluminateSupportStr::limit(strip_tags($blog->blog), 280, $end = '...') }}
                            @endif
                          </div>
                          <div class="flexInfo">
                            <p class="dateInfo">{{ $blog->created_at_fr }}</p>
                          </div>
                        </div>
                      </div>

                    @endforeach
                  </div>
                </div>
            @endif

            @if ($insta_widget)
              <h4 class="textGradient bold mb-4 mt-5">#GOODtimeLyon sur Instagram</h4>
              <div class="{{ $insta_widget }}"></div>
            @endif

            </div>
 
        </div>
    </section>

As you can see here, this text is yielded in ‘content’ :

<div id="app">
    <x-header/>

    @yield('content')

    <x-pre-footer/>

    <x-footer :homepage="$homepage ?? null"/>
</div>

WordPress plugin register_activation_hook doesnt work

So In my main plugin file I have this

class RegistrationHooks
{
    /**
     * @var string
     */
    protected string $plugin_dir;

    public function __construct()
    {
        $this->plugin_dir = WP_PLUGIN_DIR . '/invoices';
    }

    function active_invoices()
    {
        require_once $this->plugin_dir . '/includes/class-invoices.php';
        new Invoices();
    }
}

$hooksInstance = new RegistrationHooks();

register_activation_hook(__FILE__, array($hooksInstance, 'active_invoices'));

And inside My Invoices class I have this:

class Invoices
{
    public function __construct()
    {
        $this->load_dependencies();
        $this->define_admin_hooks();
    }

    private function load_dependencies()
    {
        $path = WP_PLUGIN_DIR . '/invoices';
        if ($path) {
            require_once $path . '/admin/class-admin.php';
        }
    }

    private function define_admin_hooks()
    {
        $plugin_admin = new Admin();

        add_action('admin_menu', array($plugin_admin, 'add_plugin_admin_menu'));
    }
}

And Inside my Admin class I have simple method to add item to menu

class Admin {

    public function add_plugin_admin_menu()
    {
        add_menu_page(
            'Page Title',
            'Menu Title',
            'edit_posts',
            'menu_slug',
        );
    }
}

But when I activate Plugin item doesnt get added to admin menu. When I Place my Invoices class inside my main Plugin class it works.

Cascading dynamically added fields in Symfony6

I have a form with (in the end) 3 Dropdown selections:

FieldA FieldB FieldC

with Options of FieldB dependent on the selection for fieldA and Options of FieldC dependent on the selection for fieldB

The Relations are:

EntityB ManyToMany EntityA

EntityC ManyToOne EntityB

Everything is working fine, execpt that on Submit the form is not valid with the Error being “This form should not contain extra fields” and the culprit being fieldC

what am I doing wrong?

here’s my code for the FormType:

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('fieldA', EntityType::class, [
                'class' => EntityA::class,
                'choice_label' => 'name',
                'query_builder' => function(EntityARepository $a) {
                    return $a->createQueryBuilder('a')
                        ->orderBy('a.name', 'ASC');
                },
            ])

        ;

        $builder->get('fieldA')->addEventListener(
          FormEvents::POST_SUBMIT,
          function(FormEvent $event) {
              $form = $event->getForm();
              $this->setupFieldB(
                  $form->getParent(),
                  $form->getData()
              );
          }
        );

        $builder->addEventListener(
            FormEvents::PRE_SET_DATA,
            function(FormEvent $event) {
                $data = $event->getData();
                if (!$data or !isset($data['fieldA'])) {
                    return;
                }
                $this->setupFieldB(
                    $event->getForm(),
                    $data['fieldA']
                );
            }
        );

        if ($builder->has('fieldB')) {
            $builder->get('fieldB')->addEventListener(
                FormEvents::POST_SUBMIT,
                function (FormEvent $event) {
                    $form = $event->getForm();
                    $this->setupFieldC(
                        $form->getParent(),
                        $form->getData()
                    );
                }
            );
        }

        $builder->addEventListener(
            FormEvents::PRE_SET_DATA,
            function (FormEvent $event) {
                $data = $event->getData();
                if (!$data or !isset($data['fieldB'])) {
                    return;
                }
                $this->setupFieldC(
                    $event->getForm(),
                    $data['fieldB']
                );
            }
        );
    }

    private function setupFieldB(FormInterface $form, ?string $selectedfieldA)
    {
        if (is_null($selectedfieldA)) {
            $form->remove('fieldB');
            $form->remove('fieldC');
            return;
        } else {
            $fieldA = $this->EntityARepository->findOneBy(['name' => $selectedfieldA]);
            $form
                ->add('fieldB', EntityType::class, [
                    'class' => EntityB::class,
                    'query_builder' => function (EntityBRepository $b) use ($fieldA) {
                        return $b->createQueryBuilder('b')
                            ->andWhere(':fieldA MEMBER of b.fieldAs')
                            ->setParameter('fieldA', $fieldA)
                            ->orderBy('b.name', 'ASC');
                    },
                    'choice_label' => 'name',
                ]);
        }
    }

    private function setupFieldC(FormInterface $form, ?string $selectedFieldB)
    {
        if (is_null($selectedFieldB)) {
            $form->remove('fieldC');
            return;
        } else {
            $fieldB = $this->fieldBRepository->findOneBy(['name' => $selectedFieldB]);
            $form
                ->add('fieldC', EntityType::class, [
                    'class' => EntityC::class,
                    'query_builder' => function(EntityCRepository $c) use ($fieldB) {
                        return $c->getQueryBuilderWithFilter(['fieldB' => $fieldB]);
                    },
                    'choice_label' => 'name',
                ]);
        }
    }

Return html wrapped template part Ajax call WordPress

I’ve built a custom post filter in WordPress using Ajax.

function filterPublications(filters, filterType) {
  filters = JSON.stringify(filters);
  $.ajax({
    type: 'POST',
    url: window.sage.ajax_url,
    dataType: 'html',
    data: {
      action: 'ajax_filter',
      publish: 'past',
      filters,
      posts_per_page: 3,
      filter_type: filterType,
    },
    success: response => {
      $('#publications').html( response );
    },
  })
}

And in functions.php I make a post query to query on the filtered values. What I would like is to return a template part wrapped in html for jQuery to fill the html. But I’m not sure how.

I’ve tried:

$response = '';
if ( $filtered_posts->have_posts() ) {
  while ( $filtered_posts->have_posts() ) {
    $filtered_posts->the_post();
    $response .= '<div class="col-md-4">' . get_template_part('partials/blocks/publications') . '</div>';
  }
}

echo $response;

and

$response = '';
 if ( $filtered_posts->have_posts() ) {
   while ( $filtered_posts->have_posts() ) {
     $filtered_posts->the_post();
     $response .= '<div class="col-md-4">';
     ob_start();
     get_template_part('partials/blocks/publication');
     $response .= ob_get_contents();
     ob_end_clean();
     $response .= '</div>';
   }
}

echo $response;

Both are not returning the expected response, which is the template part wrapped in the bootstrap column div. How would I do this?

Parse PHP array and store it’s value in associative array

Can anyone please help me how to parse this PHP array as It gives error in foreach loop and even It’s not working to get values using index.

$PatientTestArray = Array
(
    [0] => Array
        (
            [tube_number] => 230389414
            [test_group] => Fasting blood Sugar 
        )

    [1] => Array
        (
            [tube_number] => 230389418
            [test_group] => HbA1c 
        )

    [2] => Array
        (
            [tube_number] => 230388418
            [test_group] => HbA1c 
        )
)
print_r($PatientTestArray); //This works it print all the array
//This below code returns Null , it returns empty string.
foreach ($PatientTestArray as $key => $value) {
       echo $value;
       print_r($value);
}

The above array is fetched from mysql database and it looks like a string to me, I changed it’s type to array to parse it and also I tried different many solutions, can anyone know how can I parse below array.
I tried different solutions but nothing helps me to fix this.

Does it make sense to run more PHP-FPM children than number of CPU cores?

Assuming that I have a CPU with 4 cores and 4 threads, does it make sense to run e.g. 8 PHP-FPM workers by setting pm.max_children = 8 option? As far as I’m concerned, CPU with 4 threads can only run up to 4 processes in “real” parallel. Wouldn’t it cause an overhead if CPU time was lost due to contexts switching between these 8 processes?

In contrast, Node.js cluster mode documentation recommends to run up to as many workers/children as number of cores. Doesn’t the same recommendation apply here?

PHP Fatal error: Uncaught Error: Class ‘mysqli’ not found in /var/www/html/bWAPP/install.php:29 [duplicate]

i have this error in bWAPP in install?=yes file wite page and i found in logs file this

[Sat Apr 09 18:19:09.052868 2022] [php7:error] [pid 5345] [client 127.0.0.1:51114] PHP Fatal error:  Uncaught Error: Class 'mysqli' not found in /var/www/html/bWAPP/install.php:29nStack trace:n#0 {main}n  thrown in /var/www/html/bWAPP/install.php on line 29, referer: http://localhost/bWAPP/install.php

can any on help me?

Laravel crud, update error (Call to a member function update() on null)

So, I’m trying to make update function, using this

 public function editProfile(Request $request, $id)
{
    // Validating
    $request->validate([
        // 'username' => 'nullable|unique:users|min:4',
        // 'email' => 'nullable|unique:users|email:rfc,dns',
        'contact_phone' => 'nullable|digits_between:9,12',
        'bio_en' => 'nullable',
        'bio_ar' => 'nullable',
        'icon' => 'nullable',
        'logo' => 'nullable',
        'plan_id' => 'required',
        'category_id' => 'required',
        'is_local' => 'required',
    ]);
    
    $user = User::find($id);
    $user->update([
        'username' => $request->username,
        'email' => $request->email,
        'contact_phone' => $request->contact_phone,
        'bio_en' => $request->bio_en,
        'bio_ar' => $request->bio_ar,
        'logo' => $request->logo,
        'icon' => $request->icon,
        'plan_id' => $request->plan_id,
        'category_id' => $request->category_id,
        'referred_by_id' => Auth::user()->id,
    ]);



    if ($user) {
        return back()->with("success", __("editedSuccessfully"));
    } else {
        return back()->with('error', __("somethingWentWrongTryAgainLater"));
    }
}

}

but I get the error
Call to a member function update() on null
shows on line $user->update
hope anyone can help me

error show

Can not show matrix in html

I have a php code but don’t know how to show it in HTML table. I created matrix tables to add and multiply but don’t know how to put results in HTML table. I tried to put the code between script tags but it didn’t work. My matrix func basically generates 4 by 4 matrices with random integers and generates two matrices called A and B. then I created two other functions to add and multiply these matrices but I didn’t print them out in HTML table.
My code:

// creating function addMatrix which takes two numbers and returns a new matrix
function addMatrix($A, $B)
{
    // declaring $ADD as a empty array
    $ADD = array();
    // iterate from i is equal to 0, i is less than 4 and increment i by 1
    for ($i = 0; $i < 4; $i++) {
        // iterate from j is equal to 0, j is less than 4 and increment j by 1
        for ($j = 0; $j < 4; $j++) {
            // adding $A[$i][$j] to $B[$i][$j] and store the result in $ADD[$i][$j]
            $ADD[$i][$j] = $A[$i][$j] + $B[$i][$j];
        }
    }
    // return $ADD
    return $ADD;
}

// creating function mulMatrix which takes two numbers and returns a new matrix
function mulMatrix($A, $B)
{
    // declaring $MUL as a empty array
    $MUL = array();
    // iterate from i is equal to 0, i is less than 4 and increment i by 1
    for ($i = 0; $i < 4; $i++) {
        // iterate from j is equal to 0, j is less than 4 and increment j by 1
        for ($j = 0; $j < 4; $j++) {
            // assign 0 in $MUL[$i][]
            $MUL[$i][] = 0;
            // iterate from k is equal to 0, k is less than 4 and increment k by 1
            for ($k = 0; $k < 4; $k++) {
                // multiply $ADD[$i][$k] with $B[$k][$j] then add it in $MUL[$i][$j] and store it
                // in $MUL[$i][$j]
                $MUL[$i][$j] += $A[$i][$k] * $B[$k][$j];
            }
        }
    }
    // return $MUL
    return $MUL;
}


// generate matrix by calling generateMatrix and store it in $A
$A = generateMatrix();
// generate matrix by calling generateMatrix and store it in $B
$B = generateMatrix();
// add matrix by calling addMatrix and store it in $ADD
$ADD = addMatrix($A, $B);
// mul matrix by calling mulMatrix and store it in $MUL
$MUL = mulMatrix($A, $B);

// create element table and th
echo "<table border='1' cellspacing='0' cellpadding='10'><th colspan=4>Matrix 'A'</th>";
// iterate from i is equal to 0, i is less than 4 and increment i by 1
for ($i = 0; $i < 4; $i++) {
    // create element tr
    echo "<tr>";
    // iterate from j is equal to 0, j is less than 4 and increment j by 1
    for ($j = 0; $j < 4; $j++) {
        // display value of $A[$i][$j] with element td
        echo "<td>" . $A[$i][$j] . "</td>";
    }
    // create element end tr table
    echo "</tr>";
}
// create element end tag table
echo "</table>";
// create element br
echo "<br>";

// create element table and th
echo "<table border='1' cellspacing='0' cellpadding='10'><th colspan=4>Matrix 'B'</th>";
// iterate from j is equal to 0, j is less than 4 and increment j by 1
for ($i = 0; $i < 4; $i++) {
    // create element tr
    echo "<tr>";
    // iterate from j is equal to 0, j is less than 4 and increment j by 1
    for ($j = 0; $j < 4; $j++) {
        // display value of $A[$i][$j] with element td
        echo "<td>" . $B[$i][$j] . "</td>";
    }
    // create element end tr table
    echo "</tr>";
}
// create element end tr table
echo "</table>";


// create element br
echo "<br>";
// create element table and th
echo "<table border='1' cellspacing='0' cellpadding='10'><th colspan=4>Matrix 'A' + 'B'</th>";
// iterate from i is equal to 0, i is less than 4 and increment i by 1
for ($i = 0; $i < 4; $i++) {
    // create element tr
    echo "<tr>";
    // iterate from j is equal to 0, j is less than 4 and increment j by 1
    for ($j = 0; $j < 4; $j++) {
        // display value of $ADD[$i][$j] with element td
        echo "<td>" . $ADD[$i][$j] . "</td>";
    }
    // create element end tr table
    echo "</tr>";
}
// create element end tr table
echo "</table>";

// create element br
echo "<br>";
// create element table and th
echo "<table border='1' cellspacing='0' cellpadding='10'><th colspan=4>Matrix 'A' * 'B'</th>";
// iterate from i is equal to 0, i is less than 4 and increment i by 1
for ($i = 0; $i < 4; $i++) {
    // create element tr
    echo "<tr>";
    // iterate from j is equal to 0, j is less than 4 and increment j by 1
    for ($j = 0; $j < 4; $j++) {
        // display value of $MUL[$i][$j] with element td        
        echo "<td>" . $MUL[$i][$j] . "</td>";
    }
    // create element end tr table
    echo "</tr>";
}
// create element end tr table
echo "</table>";here

Wampserver Too few arguments to function listen_ports()?

I have just installed wampserver64 (v: wampserver3.2.6_x64) on window10 and after running wampserver, the icon is green but not connecting to localhost.
The page took too much time to load and then gave a response

This site can’t be reached
The connection was reset.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_RESET

Then I tried just “localhost” in the search bar and it gave me the following error
enter image description here

Fatal error: Uncaught ArgumentCountError: Too few arguments to function listen_ports(), 0 passed in C:wamp64wwwindex.php on line 40 and exactly 1 expected in C:wamp64scriptswampserver.lib.php on line 529

Kindly help out me. I have changed port 80 to 8080 but the same error. Thanks!