Run Joomla in Swoole ?

Moderator: mindphp

cct

Run Joomla in Swoole ?

โพสต์ที่ยังไม่ได้อ่าน โดย cct »

Run Joomla in Swoole ?
Hi
I wonder if anyone have experience of use swoole with Joomla similar like Drupal and Wordpress for swoole.
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 46159
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: Run Joomla in Swoole ?

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

Yes, you can run Joomla on Swoole, but it requires setting up a Swoole HTTP server and adapting Joomla to work in Swoole's asynchronous environment. This involves simulating PHP superglobals ($_GET, $_POST, etc.) and addressing challenges with Joomla's session handling and extensions compatibility.

It’s ideal for improving performance in specific use cases, like APIs,
but may require significant testing and adjustments.
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 46159
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: Run Joomla in Swoole ?

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

Set Up a Swoole HTTP Server
Create a custom PHP script to act as the Swoole HTTP server. For example:

โค้ด: เลือกทั้งหมด

<?php
use Swoole\Http\Server;

$server = new Server("0.0.0.0", 9501);

$server->on("start", function ($server) {
    echo "Swoole server started at http://127.0.0.1:9501\n";
});

$server->on("request", function ($request, $response) {
    // Simulate a PHP environment for Joomla
    $_SERVER = $request->server;
    $_GET = $request->get ?? [];
    $_POST = $request->post ?? [];
    $_COOKIE = $request->cookie ?? [];
    $_FILES = $request->files ?? [];
    
    ob_start();
    include __DIR__ . '/index.php';
    $content = ob_get_clean();

    $response->header("Content-Type", "text/html");
    $response->end($content);
});

$server->start();
Save this file, for instance, as swoole-server.php.

Adjust Joomla's Configuration
Ensure Joomla can handle the non-traditional server setup:
Update the configuration.php file if needed to match the Swoole server environment.
Joomla’s index.php and framework might need slight tweaks to adapt to the Swoole request lifecycle.

Start the Swoole Server

โค้ด: เลือกทั้งหมด

php swoole-server.php
Enjoy your joomla on swoole or fix bug ... :lol:
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
byronvoyle
PHP Newbie
PHP Newbie
โพสต์: 1
ลงทะเบียนเมื่อ: 26/12/2024 9:33 am

Re: Run Joomla in Swoole ?

โพสต์ที่ยังไม่ได้อ่าน โดย byronvoyle »

Well, it seems like things are quite complicated. I tried and got errors :(.
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 46159
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: Run Joomla in Swoole ?

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

byronvoyle เขียน: 26/12/2024 9:39 am Well, it seems like things are quite complicated. I tried and got errors :(.
show command and
show your errors .
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 3