PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Jun 24, 2023 19:52
I see, thanks
Jun 24, 2023 19:39
It works well now, but looks like written by a junior 🙂
Jun 24, 2023 19:39
$metadata = [];
if (!is_null($email)) {
    array_push($metadata, $email);
}
if (!is_null($mobile)) {
    array_push($metadata, $mobile);
}
Jun 24, 2023 19:38
Any idea how can I write this logic better?
Feb 23, 2023 19:55
I see, thx
Feb 23, 2023 19:42
Since I've used concat operator (.=), for the first time it throws that warning .. any idea how can I handle it?
Feb 23, 2023 19:41
it throws: "Warning: Undefined array key 35811 in .."
Feb 23, 2023 19:41
$FullCmnt = [];
while($end_cmnt = $sth_cmnt->fetch(PDO::FETCH_ASSOC))	{
	$FullCmnt[$end_cmnt['post_id']] .= '<tr id="comment-'.$end_cmnt['id'].'"> ... </tr>";
Feb 23, 2023 19:41
Please take a look at the following code:
Jan 22, 2023 21:50
ah, you mean there is a flag like docker run <image-name> --mount-local-dir ?
Jan 22, 2023 21:49
emm, how you mean exactly?
Jan 22, 2023 21:45
ah ok, thx
Jan 22, 2023 21:44
Is it possible to put a file inside a running container? I can download a file using CURL inside a container by login as -it mode. But is it possible to copy paste a local file inside it? (windows)
Jan 8, 2023 19:23
You were right .. I reinstalled the OS and it's working as expected now .. thx pal
Jan 8, 2023 19:19
Linux server3.panel01.com 4.18.0-305.3.1.el8_4.x86_64 #1 SMP Wed Jun 2 03:19:21 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
Jan 8, 2023 19:19
And the res of uname -a:
Jan 8, 2023 19:18
cat: /etc/lsb-release: No such file or directory
Jan 8, 2023 19:17
Oh, so the OS is no ubuntu .. got it thx
Jan 8, 2023 19:16
Noted that I've tested apt-get command either
Jan 8, 2023 19:16
I've bought a new VPS, but the apt is not recognized in the bash .. any idea why?
Jan 8, 2023 19:15
Dec 24, 2022 20:03
I downloded the tar file, any idea how can I run it? (I'm not familiar with linux)
Dec 24, 2022 20:03
Dec 24, 2022 20:03
I was trying to install grafana using apt-get (on ubuntu) but it failed and I am trying to install it manually
Dec 17, 2022 14:07
@Danack Yeah I did it somehow .. It's either fpm or mysql that consumes that huge tarffic
Dec 17, 2022 09:22
I see .. thanks for your explanations
Dec 17, 2022 09:17
any idea how can I kill it? Or at least how can I monitor the issue to get a clue about the problem?
Dec 17, 2022 09:17
Based on some investigation, apparently there is a trojan in the server that consumes that traffic
Dec 17, 2022 09:16
As a question about server-security, I have a VPS that Ubuntu is installed on it. After a short time, the whole bandwidth (20TB) gets finished.
Nov 24, 2022 08:51
got it
Nov 24, 2022 08:51
ah I see ..
Nov 24, 2022 08:48
Also, I want to install phpmyadmin, do you know should I install it inside which container? MySQL, PHP, Nginx?
Nov 24, 2022 08:40
thx
Nov 24, 2022 08:27
I think the left one is my local computer port, am I right?
Nov 24, 2022 08:27
Guys any idea which one is my local computer port and which one is the port on the docker container?
Nov 24, 2022 08:27
Nov 11, 2022 16:24
Ok, after enabling "rewrite" the error changed again .. please igonre what I said above .. I guess I can handle it ..
Nov 11, 2022 16:15
Ok, after replacing AllowOverride None with AllowOverride All, now the error changed from 404 to 500 :-(
Nov 11, 2022 16:09
Nothing inserts inside /var/log/apache2/error.log when I get 404 NOT fount error
Nov 11, 2022 16:09
Any idea how can I debug and see what's wrong?
Nov 11, 2022 16:09
I'm trying to put my website on a new server, I don't use docker .. after pulling the code base on the new server and installing needed packages, the home page works, but the internal links doesn't work like this
Sep 14, 2022 15:48
I see .. ok thx
Sep 14, 2022 15:45
any idea how can I rollback ?
Sep 14, 2022 15:45
I was on the master branch and I executed git pull origin new_branch .. Suddenly the new_branch changes got merged with the master branch
Aug 18, 2022 18:37
any idea how to return the result immediately without waiting 10 sec?
Aug 18, 2022 18:36
public function(){

    // codes here

    // One month passed from the last fetch
    if ( true ) {
        $this->doTheJob();
    }

    return $data;
}

public function doTheJob(){

    sleep(10); // simplified for a API fetch/crawling

    // Insert something in the database
}
Aug 13, 2022 08:19
class Subclass implements SuperClass
Aug 13, 2022 08:19
now I want to know, is it the same when we use implements instead of extends? I mean is this correct too?
Aug 13, 2022 08:18
class Subclass extends SuperClass
Aug 13, 2022 08:18
As a question about "subclass" and "superclass", I know this: