Jump to content


  • Posts

  • Joined

  • Last visited

Jintor's Achievements


Member (2/5)



  1. digging on the web I found this ps eax |grep php |grep -v grep|awk '{print $1 $8 $15 $19}' it shows PID - REDIRECT_SCRIPT_URL= ..... usefull stuff to know at least what php "could" have a bad infinite loop on the code....
  2. CONTEXT : I have many php scripts executing live... WHAT I DO : pgrep -ia php (to get details of the process containing php...) option -ia show the command... WHAT I GET : 112233 /opt/cpanel/ea-php80/root/usr/bin/php-cgi 223355 /opt/cpanel/ea-php80/root/usr/bin/php /home/..some.php QUESTION : The php processes that shows the executing file are ..../bin/php The php processes that don't show the command have ..../bin/php-cgi `/opt/cpanel/ea-php80/root/usr/bin/php-cgi` => How can I digg deeper to understand what php is doing in those processes ? they run for long time, can I kill them without causing problems ? what is they comes back, how can I pinpoint if there is a bad line of code executing ?? (note : I checked error_log file => no error are being reported) but thoses php-cgi tends to come back.... why ? WHAT I TRIED {1} : pidstat -p 112233 Linux 4.18.0-305.19.1.el8_4.x86_64 (host.example.com) 2021-10-14 _x86_64_ (8 CPU) 05:08:53 PM UID PID %usr %system %guest %wait %CPU CPU Command 05:08:53 PM 1001 1234277 0.00 0.00 0.00 0.00 0.00 6 php-cgi WHAT I TRIED {2} : pstree -aps 112233 systemd,1 --switched-root --system --deserialize 17 └─httpd,3515834 -k start └─httpd,1233812 -k start └─php-cgi,112233 WHAT I TRIED {3} : lsof -p 1234277 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php-cgi 1234277 stubfeed cwd DIR 252,1 32 62973745 /home/user/public_html/.... php-cgi 1234277 stubfeed rtd DIR 252,1 4096 128 / php-cgi 1234277 stubfeed txt REG 252,1 6387136 138429576 /opt/cpanel/ea-php80/root/usr/bin/php-cgi php-cgi 1234277 stubfeed DEL REG 0,1 110106200 /dev/zero php-cgi 1234277 user mem REG 252,1 315112 578898832 /opt/cpanel/ea-php80/root/usr/lib64/php/modules/mailparse.so php-cgi 1234277 user mem
  3. My apache is also at output buffer off I don't use NGINX and I uninstalled PHP-FPM from my server ==> note : since I did that my websites are 10x to 100x faster. ( I hope no one here will hire a hitman to finish me... when I said "remove PHP-FPM" in stackoverflow I was removed the right to ask new questions....... fans of PHP-FPM are angry at me. ) with all that => echo '1'; sleep(2); echo '2'; sleep(2); echo '3'; sleep(2); echo '4'; sleep(2); .... ==> I see 1, then wait, then 2, then wait, etc. => with PHP-FPM or "fast-cgi" or output_buffer on => i wait very long and then 123 This setup works with centos 7, centos8 and AlmaLinux
  4. I tried web sockets, but with the secure version wss => was "waiting the end of the script to push the info...."
  5. Turns out I was deceived by https://tools.pingdom.com/ ..... it says I don't have gzip..... but other tools like https://www.webpagetest.org/show I do. I use Clouflare with brotli and http3 active... the brotli thing does compressed output each echo (output buffer on or off)... 😀
  6. what else can I try other than header('Content-Type:gzip;'); ?? **** FOR THE WHY : some php can take long time to execute, so outputting each echo gives "feed backs" to the user. 1 of many example : FFMPEG takes long time to convert, with PHP and can echo stuff while the ffmpeg is being executed to show the compression progress an other example : some advanced search => with a script that does many queries in different tables => echoing results while continue to search.... an other example : probing travel GDS API => echoing results as they come ** Handled by server in PHP ==> in apache or php.ini ?
  7. CONTEXT (1) : I know that output_buffer off + gzip output don't "mix" well together. CONTEXT (1) : But I need output_buffer off. TEST (1) : In php I can gzcompress(); $a = 'this is a sting'.'<br>'; $b = gzcompress($a,6); echo $b; // but the result is this x�+��,V�D��̼t��";D��� TEST (2) : if I add ( at the top of my php header('Content-Type:gzip;'); ==> the result is this xœ+ÉÈ,V�¢D…â’̼t›¤";�DáÉ (in the browser) QUESTION : So is there a way to digg deeper and "tell" the receiving browser to ungzip that output ??
  8. I usually "clean" user input before adding to the database. the retrieved $_REQUEST['input...'] => I replace all quotes ' with ’ (right single quotation) and double quotes " by ” (right double quotation) when inserting right single or double quotation marks, it fits without the need of escaping....
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.