Why I get error with request to Google Identity Toolkit

I work with restAPI Identity Toolkit.

I get good response with request

POST https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode

but there is a parameter ‘returnOobLink’ by default it’s false.
When I set it true to get OobCode for building my own custom request, I get error

{error:
    code: 400,
    message: 'INNSUFFICIENT_PERMISSION'
}

Which permission needs?

How to play mp4 video from url in php

I want to play mp4 video from url but not playing..

This is php code mp4.php


$video_file = 'https://opsukrat.in/Test.mp4';

$size = filesize($video_file);

header("Content-Type: video/mp4");

header("Content-Length: ".$size);

readfile($video_file);

This is html code



<video width="480" height="320" controls>

  <source src="mp4.php" type="video/mp4">

</video>

GET http://myproject.com/insertData?product_id=1&amount=100&item=shoes 500 (Internal Server Error) [closed]

this is error :- GET http://myproject.com/insertData?amount=100&item=shoes 500 (Internal Server Error)

this is a javascript code :-

          <script type="text/javascript">
            document.addEventListener('DOMContentLoaded', function() {
                var form = document.getElementById('paypal_form');
                form.addEventListener('submit', function() {
                   
                    setData(document.getElementById('amount').value, document.getElementById('item').value);
                   
                });

                function setData(amount, item) {
                    
                    var xhttp = new XMLHttpRequest();
                    xhttp.onreadystatechange = function() { 
                    };
                    xhttp.open("GET", "/insertData? 
                    amount="+amount+"&item="+item, true);
                    xhttp.send();
                }
            });
          </script>

this is a insertdata code :-

          <?php 
          session_start();
         // Include database connection file 
          include_once 'dbConnect.phtml';

         $amount = $_GET['amount'];
         $item = $_GET['item'];
         $status = "pending";

         $insert = $db->query("INSERT INTO product(product_name, 
         price, status1) 
         VALUES('".$item."','".$amount."','".$status."')");

         if (!$insert) {
          die("Error: " . $db->error);
         }

         $last_id = $db->insert_id;

         $_SESSION['product_id'] = $last_id;

I am using laminas framework for develop app with PayPal. but its not save data to databases come this error. I need to fix this.

     'insertData' => [
                'type'    => Literal::class,
                'options' => [
                    'route'    => '/insertData',
                    'defaults' => [
                        'controller' => 
       ControllerViewController::class,
                        'action'     => 'insertData',
                    ],
                ],
            ],

this is a route in module.config.php

Connexion Intermittence: MongoDB from Php7.4

I have problems with intermittence in connection to mongodb since PHP 7.4. I don’t understand why sometimes it fails to connect to ReplicaSet. What can I do ?
I leave the log of my application below.

[18:58] [Worker 1] [109] Process with id 64bf99167c2a42530a2dbd97 has finished
[18:58] [Worker 1] [88] Start processing Process with id 64b920317c2a42530a2dbd72
[18:58] [Worker 1] [109] Process with id 64b920317c2a42530a2dbd72 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64e61827874b0d115f5797d3
[19:00] [Worker 1] [109] Process with id 64e61827874b0d115f5797d3 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64c37883921ed7598d54a694
[19:00] [Worker 1] [109] Process with id 64c37883921ed7598d54a694 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64bf99167c2a42530a2dbd97
[19:00] [Worker 1] [109] Process with id 64bf99167c2a42530a2dbd97 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64b920317c2a42530a2dbd72
[19:00] [Worker 1] [109] Process with id 64b920317c2a42530a2dbd72 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64e61827874b0d115f5797d3
[19:02] [Worker 1] [109] Process with id 64e61827874b0d115f5797d3 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64c37883921ed7598d54a694
[19:02] [Worker 1] [109] Process with id 64c37883921ed7598d54a694 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64bf99167c2a42530a2dbd97
[19:02] [Worker 1] [109] Process with id 64bf99167c2a42530a2dbd97 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64b920317c2a42530a2dbd72
[19:02] [Worker 1] [109] Process with id 64b920317c2a42530a2dbd72 has finished
[19:02] [Worker 1] [132] An error has ocurred on Process 64b920317c2a42530a2dbd72. Error Details: No suitable servers found (`serverSelectionTryOnce` set) on vendor/mongodb/mongodb/src/functions.php line 487 Trace: #0 vendor/mongodb/mongodb/src/functions.php(487): MongoDBDriverManager->selectServer()
#1 vendor/mongodb/mongodb/src/Collection.php(687): MongoDBselect_server()
#2 libs/Mongodb/Collection.php(412): MongoDBCollection->findOne()
#3 models/UserCollection.php(242): AppLibrariesMongodbCollection::findFirst()
#4 config/Injector.php(76): AppCollectionsUserCollection::findFirst()
#5 models/CoreCollection.php(182): AppCollectionsCoreCollection::getUser()
#6 models/ProcessCollection.php(454): AppCollectionsCoreCollection->save()
#7 tasks/ProcessTask.php(112): AppCollectionsProcessCollection->save()
#8 [internal function]: AppTasksProcessTask->AppTasks{closure}()
#9 vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AMQPChannel.php(1055): call_user_func()
#10 [internal function]: PhpAmqpLibChannelAMQPChannel->basic_deliver()
#11 vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(220): call_user_func()
#12 vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(374): PhpAmqpLibChannelAbstractChannel->dispatch()
#13 services/Queue/Worker.php(58): PhpAmqpLibChannelAbstractChannel->wait()
#14 tasks/ProcessTask.php(143): AppServicesQueueWorker->consume()
#15 [internal function]: AppTasksProcessTask->consumeAction()
#16 [internal function]: PhalconCliDispatcher->callActionMethod()
#17 [internal function]: PhalconDispatcherAbstractDispatcher->dispatch()
#18 run(27): PhalconCliConsole->handle()
#19 {main} 
[19:04] [Worker 1] [88] Start processing Process with id 64e61827874b0d115f5797d3
[19:04] [Worker 1] [109] Process with id 64e61827874b0d115f5797d3 has finished
[19:04] [Worker 1] [88] Start processing Process with id 64c37883921ed7598d54a694

FakerPHP generate names in several locales without titles

I have a script to generate a list of names using FakerPHP in different Locales:

<?php
require_once(__DIR__ . "/vendor/autoload.php");
$gen_num = $sortBy = filter_input(INPUT_GET, 'num2gen', FILTER_SANITIZE_NUMBER_INT, array('options' => array('default' => 30, 'min' => 10, 'max' => 300)));

$faker_langs = ['da_DK', 'sv_SE', 'nb_NO', 'fr_FR', 'pl_PL', 'fi_FI', 'en_GB']; //'de_DE', 
$fakers = [];
foreach ($faker_langs as $l) {
    $fakers[] = FakerFactory::create($l);
}


for ($x = 0; $x < $gen_num; $x++) {
    $lang = rand(0, count($faker_langs) - 1);
    echo $fakers[$lang]->name() . "n";
}

I want this list to validate full names, but the titles that are generated in Polish and German introduce a lot of noise.

I noticed that the Danish formats do not include titles, but the German and Polish do:

Danish

https://github.com/FakerPHP/Faker/blob/main/src/Faker/Provider/da_DK/Person.php

    protected static $maleNameFormats = [
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{middleName}} {{lastName}}',
        '{{firstNameMale}} {{middleName}} {{lastName}}',
        '{{firstNameMale}} {{middleName}}-{{middleName}} {{lastName}}',
        '{{firstNameMale}} {{middleName}} {{middleName}}-{{lastName}}',
    ];

German

https://github.com/FakerPHP/Faker/blob/main/src/Faker/Provider/de_DE/Person.php

    protected static $maleNameFormats = [
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}}-{{lastName}}',
        '{{titleMale}} {{firstNameMale}} {{lastName}}',
        '{{firstNameMale}} {{lastName}} {{suffix}}',
        '{{titleMale}} {{firstNameMale}} {{lastName}} {{suffix}}',
    ];

Is it possible to omit the {{titleMale}} and {{suffix}} ordo I have to create a new Provider inherriting the de_DE one and overriding the $maleNameFormats for the languages that have titles in their formatters?

php – Warning : mail() verify your SMTP and smtp_port setting

I was trying to make a working contact form using html and php but when i enter the name and email and message then click send, it shows this error
I am using normal local host with php (in cmd : $ php -S localhost:4000)

<br />
<b>Warning</b>: mail(): Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in <b>C:UsersBKMHDownloadsYahyai mustn't uplaod to mega but i need my filesProjectsWebsitesHtmlInteresitingGoodDesignePortfoliophpmessage.php</b> on line <b>12</b><br />
Sorry, failed to send your message!

and here is my php code: ( i am new to php )

<?php
  $name = htmlspecialchars($_POST['name']);
  $email = htmlspecialchars($_POST['email']);
  $message = htmlspecialchars($_POST['message']);

  if(!empty($email) && !empty($message)){
    if(filter_var($email, FILTER_VALIDATE_EMAIL)){
      $receiver = "[email protected]"; //enter that email address where you want to receive all messages
      $subject = "From: $name <$email>";
      $body = "Name: $namenEmail: $emailnnMessage:n$messagennRegards,n$name";
      $sender = "From: $email";
      if(mail($receiver, $subject, $body, $sender)){
         echo "Your message has been sent";
      }else{
         echo "Sorry, failed to send your message!";
      }
    }else{
      echo "Enter a valid email address!";
    }
  }else{
    echo "Email and message field is required!";
  }
?>

I spent two hours searching but i couldn’t find any working solution, please help, and thanks

I’m doing a laminas framework tutorial and getting some errors trying to access localhost/album

The error code is LaminasServiceManagerExceptionServiceNotFoundException
File:
D:Projectsvalidationvendorlaminaslaminas-servicemanagersrcServiceManager.php:586

The error message is Unable to resolve service “LaminasDbAdapterAdapterInterface” to a factory; are you certain you provided it during configuration?

Module.php file:

<?php
namespace Album;
use LaminasDbAdapterAdapterInterface;
use LaminasDbResultSetResultSet;
use LaminasDbTableGatewayTableGateway;
use LaminasModuleManagerFeatureConfigProviderInterface;

class Module implements ConfigProviderInterface
{
public function getConfig()
{
return include __DIR__ . '/../config/module.config.php';
}
    public function getServiceConfig()
    {
        return [
            'factories' => [
                ModelAlbumTable::class => function($container) {
                    $tableGateway = $container->get(ModelAlbumTableGateway::class);
                    return new ModelAlbumTable($tableGateway);
                },
                ModelAlbumTableGateway::class => function ($container) {
                    $dbAdapter = $container->get(AdapterInterface::class);
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new ModelAlbum());
                    return new TableGateway('album', $dbAdapter, null, $resultSetPrototype);
                },
            ],
        ];
    }
    public function getControllerConfig()
    {
        return [
            'factories' => [
                ControllerAlbumController::class => function($container) {
                    return new ControllerAlbumController(
                        $container->get(ModelAlbumTable::class)
                    );
                },
            ],
        ];
    }
}

module.config.php file:

<?php
namespace Album;
use LaminasRouterHttpSegment;


return [

    'router' => [
        'routes' => [
            'album' => [
                'type'    => Segment::class,
                'options' => [
                    'route' => '/album[/:action[/:id]]',
                    'constraints' => [
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ],
                    'defaults' => [
                        'controller' => ControllerAlbumController::class,
                        'action'     => 'index',
                    ],
                ],
            ],
        ],
    ],

    'view_manager' => [
        'template_path_stack' => [
            'album' => __DIR__ . '/../view',
        ],
    ],
];

modules.config.php file:

<?php

/**
 * List of enabled modules for this application.
 *
 * This should be an array of module namespaces used in the application.
 */
return [
    'LaminasRouter',
    'LaminasValidator',
    'Application',
    'Album',
];

The problem seems to be that the tutorial uses LaminasDb service that isnt there anymore in the modules.config.php file, the tutorial shows a modules.config.php file that is different than mine, I tried adding ‘LaminasDb’ there but this just results in a different error.

Can not display username when using Cordova

My code works perfectly fine when I use it locally and can access the server (using XAMPP).
However, when I run it through Cordova I can not display the username. The username is saved as a $_SESSION variable in the login.php file when the user logs in, but gets the error message Warning: Undefined array key “username”.
The postings of the web application are shown, so I know I can access the server when using Cordova as well.

In the HTML file, the displayUserName() function is called onload which sends a request to displayName.php.

The displayAllPosts() function works.

Any help would be appreciated.

<?php

session_start();
// Establish connection to database
include("connection.php");

header('Access-Control-Allow-Origin: *');
//header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
//header('Access-Control-Allow-Headers: Content-Type');



// Setting the vairables for the email and password.
$email = $_POST['email'];
$password = $_POST['password'];

//SQL query for retrieving the username and userID where email is 
//current email and password is current password.
$sql_user = "SELECT username, user_id FROM users WHERE email = '$email' AND password = '$password'";

// Store the result from the sql query
$result_user = mysqli_query($link, $sql_user) or die (mysqli_connect($link));

// Check if there is data returned.
// If num of rows returned is 0, then there is no registered user with
// the provided email and password
if ((mysqli_num_rows($result_user) < 1)){
    echo 1;
}

// Otherwise the username and password has been found in the db.
else{
    //Saving the result as an associative array called row.
    $row = mysqli_fetch_array($result_user);
    //Setting the session variable for username and user id. 
    $_SESSION['username'] = $row['username'];
    $_SESSION['user_id'] = $row['user_id'];
    
    echo 2;
}
// Close the connection to the db
$conn->close();

?>

<?php

session_start();
// Establish connection to database
include("connection.php");

header('Access-Control-Allow-Origin: *');
//header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
//header('Access-Control-Allow-Headers: Content-Type');

// Session vaiable for username when logged in. 
echo $_SESSION['username'];

?>

function displayUserName() {

    $.ajax({
        url: 'http://MY_IP_ADDRESS/test/server/displayName.php',
        type: 'GET',
        data: {},
        success: function (userdata) {
            // Not found in db. Provide feedback to user.
            if (!userdata) {
                document.getElementById("displayname").innerHTML = "No text";
            }
            //Successfully found in db and username will be displayed.
            if (userdata) {
                document.getElementById("displayname").innerHTML = "Inloggad: " + userdata;
            }
        }
    });
};

function displayAllPosts() {

    $.ajax({
        url: 'http://MY_IP_ADDRESS/test/server/displayAllPosts.php',
        type: 'GET',
        data: {},
        dataType: "json",
        success: function (data) {
            //Check if there is data. 
            if (!data) {
                document.getElementById("displayAllPosts").innerHTML = "no data.";
            }
            else {
                //Create a constant to determine in which element the postings 
                //should be displayed. This element will be the parent element.
                const allPosts = document.getElementById('displayAllPosts');
<body onload="displayUserName(); displayAllPosts()">
    <!-- Here is the logo -->
    <div class="container pt-3 pb-3">
        <div class="row">
            <div class="justify-content-center">
                <img src="img/hth.png" alt="Here to help logo" width="300" height="100">
            </div>
        </div>
    </div>
    <!-- Display the username that is logged in-->
    <div class="container pt-3 pb-1">
        <div class="row">
            <div class="col d-flex justify-content-end" id="displayname">

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

    <!-- Display the name of the section-->
    <div class="container pt-1 pb-3">
        <div class="row">
            <div class="col d-flex justify-content-center">
                <h1>Inlägg</h1>
            </div>
        </div>
    </div>
    
    <!-- Div to display all posts-->
    <div class="container pt-1 pb-3">
        <div class="row">
            <div class="event-wrapper" id="displayAllPosts">

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

I have issue to retrive post thumbnail with rest api

i have two site. main site and blog site. both of them are wordpress. i want show my latest post from
blog site to main site. but I have issue to retrieve post thumbnail.
all thing is OK except Thumbnail.

wp_get_attachment_image_src(get_post_thumbnail_id($post['id']), 'thumbnail') 

retrive false.

function display_latest_blog_posts() {
    ob_start(); // Start output buffering

    // Replace with the URL of your blog site
    $blog_site_url = 'http://www.blog.domain.com';

    // Get the latest blog posts using WP REST API
    $response = wp_remote_get($blog_site_url . '/wp-json/wp/v2/posts?per_page=3');
    $posts = wp_remote_retrieve_body($response);

    if (!empty($posts)) {
        $posts = json_decode($posts, true);

        echo '<div class="latest-blog-posts">';
        
        foreach ($posts as $post) {
            echo '<div class="post">';
            echo '<h2 class="post-title">' . $post['title']['rendered'] . '</h2>';
            echo '<p class="post-date">' . date('F j, Y', strtotime($post['date'])) . '</p>';
            
            if (has_post_thumbnail($post['id'])) {
                $thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id($post['id']), 'thumbnail')[0];
                echo '<img src="' . $thumbnail_url . '" class="post-thumbnail" alt="' . $post['title']['rendered'] . '">';
            }
            
            echo '</div>';
        }
        
        echo '</div>';
    }

    $output = ob_get_clean(); // Get the buffered content
    return $output;
}

Does anyone know where the problem is?

i have two site. main site and blog site. both of them are wordpress. i want show my latest post from
blog site to main site. but I have issue to retrieve post thumbnail.
all thing is OK except Thumbnail.

Docker- PHP application image for deployment not working locally

I am trying to test my php server to run the application before deploying it on AWS (first time) Doesn’t work for me locally with my docker configuration.

I use:

docker build -f docker-configs/php/Dockerfile -t php-service .

docker run -p 9000:9000  php-service

and there is no response from localhost:9000

Logs show:

[23-Aug-2023 08:37:53] NOTICE: fpm is running, pid 1

[23-Aug-2023 08:37:53] NOTICE: ready to handle connections

but can’t connect.

My Dockerfile

FROM php:8.2-fpm

RUN apt-get update && apt-get install -y 
    git 
    unzip 
    libicu-dev 
    libpq-dev 
    wget 
    && apt-get install -y 
    librabbitmq-dev 
    libssh-dev 
    sqlite3 
    libsqlite3-dev 
    && docker-php-ext-install 
    bcmath 
    sockets 
    pdo pdo_mysql pdo_sqlite 
    && pecl install amqp 
    && docker-php-ext-enable amqp

# Installing Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && composer --version

RUN apt-get -y install cron default-mysql-client

WORKDIR /app

# Copy application files into the container
COPY . /app

# Expose port 9000 for the PHP-FPM server
EXPOSE 9000

# The startup command to run PHP-FPM
CMD ["php-fpm"]

Also, I found out that – PHP-FPM doesn’t handle HTTP requests directly; it needs a web server like Nginx or Apache to translate HTTP requests into FastCGI requests that PHP-FPM can handle.

So I guess need image which I can access with HTTP request?

Also my docker-compose.yaml file

version: '3.8'
services:
  nginx:
    image: nginx:latest
    ports:
      - "80:80"
    volumes:
      - "./docker-configs/nginx.conf:/etc/nginx/conf.d/default.conf"
      - ".:/app:cached"
  php:
    build:
      context: ./docker-configs/php
    volumes:
      - "./docker-configs/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
      - ".:/app:cached"
    environment:
      PHP_IDE_CONFIG: "serverName=Docker"

  database:
    image: nouchka/sqlite3:latest
    stdin_open: true
    tty: true
    volumes:
      - ./sqlite-data:/var/lib/sqlite

Can someone please help? Thanks

How to solve the Undefined MYSQLI and Uncaught TypeError: MySQLI_Query()

Please help me to solve this,

Warning: Undefined variable $mysqli in
C:xampphtdocssyslaporanauthauth.php on line 10

Fatal error: Uncaught TypeError: mysqli_query(): Argument #1 ($mysql)
must be of type mysqli, null given in
C:xampphtdocssyslaporanauthauth.php:10 Stack trace: #0
C:xampphtdocssyslaporanauthauth.php(10): mysqli_query(NULL,
‘SELECT * FROM t…’) #1 {main} thrown in
C:xampphtdocssyslaporanauthauth.php on line 10

I just update my XAMPP to the new one, and use PHP 8 right now. I just started to learning php and start with configure my login page.

Koneksi.php

Auth.php

Give me advice, Give me some codes to solve my problem

please help me and solve

my contact form not working …

0) {

$to = $_POST[‘to’][‘val’]; // “.
“Here are the details:

“;
foreach ($_POST as $key => $value) {
$email_body .= “” . $value[‘label’] . “: ” . $value[‘val’] . “

“;
}

$headers = “From:n”;
$headers.= “Content-Type:text/html; charset=UTF-8”;
if($email_address != “”) {
mail($to,$email_subject,$email_body,$headers);
return true;
}
}
?>

Problem authenticating users using ladps from 3 different windows domains

I am authenticating users using ladps from 3 different windows domains. Each has its own DC. I assign the certificates directly in the php code.
It works perfectly for only one domain.

Example:
After restarting Apache.
A user from domain1 logs in. It is authenticated and other users from domain1 can also authenticate.
If the user logs in from domain2 (or from another), he does not log in. An error of the certificate issuer failed to be verified appears in Apache’s error.log.
After restarting Apache.
A user from domain2 logs in. Users from domain1 (or from another) no longer.

important part of code:

               
                $certpath=$this->globalparameter->parameters["constants"]["CertifPath"];
                switch ($domainname) {
                      case "imofa":
                        $DC=$this->globalparameter->parameters["constants"]["DcIMF"];
                        $certname=$this->globalparameter->parameters["constants"]["CertifIMF"];  
                      break;
                      case "havexmobility2":
                        $upn=str_ireplace("mobility2","mobility",$upn);  //kvůli úpravě DC pro o365 
                        $DC=$this->globalparameter->parameters["constants"]["DcHXM"];
                        $certname=$this->globalparameter->parameters["constants"]["CertifHXM"]; 
                      break;
                    default:   // default je "havex2"
                        $upn=str_ireplace("havex2","havex",$upn);  //kvůli úpravě DC pro o365 
                        $DC=$this->globalparameter->parameters["constants"]["DcHXA"];
                        $certname=$this->globalparameter->parameters["constants"]["CertifHXA"];                      
                }

                ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);  //zapnout debug
                ldap_set_option(null, LDAP_OPT_X_TLS_CACERTDIR, $certpath);  
                ldap_set_option(null, LDAP_OPT_X_TLS_CACERTFILE, $certpath.'\'.$certname);                
                $s="ldaps://".$DC;
                $ds= ldap_connect($s,636);

        if ($ds) {
            ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
            ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
            error_reporting(0); 
            ldap_start_tls($ds);
            $r=ldap_bind ($ds, $upn, $password);
...
...
ldap_unbind($ds);

example log after restart apache – OK:

ldap_connect_to_host: TCP DCM1.HAVEXMOBILITY2.CZ:636
ldap_new_socket: 1660
ldap_prepare_socket: 1660
ldap_connect_to_host: Trying 192.168.30.250:636
ldap_pvt_connect: fd: 1660 tm: -1 async: 0
attempting to connect: 
connect success
TLS trace: SSL_connect:before SSL initialization
TLS trace: SSL_connect:SSLv3/TLS write client hello
TLS trace: SSL_connect:SSLv3/TLS write client hello
TLS trace: SSL_connect:SSLv3/TLS read server hello
TLS certificate verification: depth: 1, err: 0, subject: /DC=cz/DC=havexmobility2/CN=havexmobility2-DCM1-CA, issuer: /DC=cz/DC=havexmobility2/CN=havexmobility2-DCM1-CA
TLS certificate verification: depth: 0, err: 0, subject: /CN=DCM1.havexmobility2.cz, issuer: /DC=cz/DC=havexmobility2/CN=havexmobility2-DCM1-CA
TLS trace: SSL_connect:SSLv3/TLS read server certificate
TLS trace: SSL_connect:SSLv3/TLS read server key exchange
TLS trace: SSL_connect:SSLv3/TLS read server certificate request
TLS trace: SSL_connect:SSLv3/TLS read server done

example the same domain unable to get local issuer certificate:

connect success
TLS trace: SSL_connect:before SSL initialization
TLS trace: SSL_connect:SSLv3/TLS write client hello
TLS trace: SSL_connect:SSLv3/TLS write client hello
TLS trace: SSL_connect:SSLv3/TLS read server hello
TLS certificate verification: depth: 0, err: 20, subject: /CN=DCM1.havexmobility2.cz, issuer: /DC=cz/DC=havexmobility2/CN=havexmobility2-DCM1-CA
TLS certificate verification: Error, unable to get local issuer certificate
TLS trace: SSL3 alert write:fatal:unknown CA
TLS trace: SSL_connect:error in error
TLS: can't connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed (unable to get local issuer certificate).
ldap_err2string

Is it possible somewhere to force a reset before ldap_connect?

Export all contents from my Joomla website

I have a Joomla website and I recently discovered that there are a number of malicious files on different directories. I have a backup and want to setup a new Joomla site and use the previous website data from the backup database.

I checked the database and found that the content and category tables use the assets table. But do not know if there are other related tables or so. I checked the assets table and could not understand the use of lft and rgt columns.

I want to write a PHP script to copy content data from the old backup and write to a new Joomla site.

I am not that familiar with the Joomla db structure. If anyone can guide me to understand the table relations or refer me to a doc that would be a great help.