<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://wuff.dyndns.org/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://wuff.dyndns.org/feed.php">
        <title>Wulf&#039;s Various Things - php</title>
        <description></description>
        <link>http://wuff.dyndns.org/</link>
        <image rdf:resource="http://wuff.dyndns.org/lib/exe/fetch.php?media=logo.png" />
       <dc:date>2026-04-27T20:10:07+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:add-update-delete-form&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:background-process&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:docker-php-dev&amp;rev=1746318691&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:erroremail&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:implicit_ftps&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:multi-dimensional-array-compare&amp;rev=1715901213&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:php-analysis&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:php-fpm-logging&amp;rev=1738854988&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:php-mysqli&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:php5.6_on_debian9&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:php8-debian11&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:phpcsfixer&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:phplint&amp;rev=1685357735&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:phpstorm&amp;rev=1742308068&amp;do=diff"/>
                <rdf:li rdf:resource="http://wuff.dyndns.org/doku.php?id=php:start&amp;rev=1685357735&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://wuff.dyndns.org/lib/exe/fetch.php?media=logo.png">
        <title>Wulf's Various Things</title>
        <link>http://wuff.dyndns.org/</link>
        <url>http://wuff.dyndns.org/lib/exe/fetch.php?media=logo.png</url>
    </image>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:add-update-delete-form&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Add/Update/Delete Form</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:add-update-delete-form&amp;rev=1685357735&amp;do=diff</link>
        <description>Add/Update/Delete Form


&lt;html&gt;
&lt;head&gt;
&lt;title&gt;ShotDev.Com Tutorial&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?
$objConnect = mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;root&quot;) or die(mysql_error());
$objDB = mysql_select_db(&quot;mydatabase&quot;);

//*** Add Condition ***//
if($_POST[&quot;hdnCmd&quot;] == &quot;Add&quot;)
{
$strSQL = &quot;INSERT INTO customer &quot;;
$strSQL .=&quot;(CustomerID,Name,Email,CountryCode,Budget,Used) &quot;;
$strSQL .=&quot;VALUES &quot;;
$strSQL .=&quot;(&#039;&quot;.$_POST[&quot;txtAddCustomerID&quot;].&quot;&#039;,&#039;&quot;.$_POST[&quot;txtAddName&quot;].&quot;&#039; &quot;;
$strSQL .=&quot;,&#039;&quot;.$_POST[&quot;txtAddEmail&quot;].…</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:background-process&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Background process</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:background-process&amp;rev=1685357735&amp;do=diff</link>
        <description>Background process

Continue a php script after browser output (background):


ignore_user_abort(true);
set_time_limit(0);

ob_start();
// do initial processing here
echo $response; // send the response
header(&#039;Connection: close&#039;);
header(&#039;Content-Length: &#039;.ob_get_length());
ob_end_flush();
ob_flush();
flush();

// now the request is sent to the browser, but the script is still running
// so, you can continue...</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:docker-php-dev&amp;rev=1746318691&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-04T00:31:31+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Docker PHP Dev</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:docker-php-dev&amp;rev=1746318691&amp;do=diff</link>
        <description>Docker PHP Dev

&lt;https://github.com/TrafeX/docker-php-nginx&gt;

PHP,nginx,mariadb combo docker compose file with default innodb (155mb base conf dir size):


services:
  php-dev:
    image: trafex/php-nginx
    container_name: php-dev
    restart: unless-stopped
    environment:
      - PUID=1016
      - PGID=1016
      - TZ=Europe/London
    ports:
      - 7082:8080
    volumes:
      - /opt/php-dev/html:/var/www/html
      #- /opt/php-dev/php-conf/php.ini:/etc/php84/conf.d/settings.ini
      #- …</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:erroremail&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Error email</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:erroremail&amp;rev=1685357735&amp;do=diff</link>
        <description>Error email


if(is_bool($res)) {
    error_log(&quot;MySQL Result is boolean and needs corrected: $sql&quot;,1,&quot;someone@example.com&quot;);
}</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:implicit_ftps&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>FTPS</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:implicit_ftps&amp;rev=1685357735&amp;do=diff</link>
        <description>FTPS

Implicit FTPS

The code below contains examples to upload, download and delete files on an implicit FTPS server and to get a directory listing:


&lt;?php
//upload test
$server=&quot;servername&quot;;
$user=&quot;username&quot;;
$pass=&quot;password&quot;;
$remotefilename=&quot;/InBound/test.txt&quot;;
$localfilename=&quot;test.txt&quot;;

/*
$fp = fopen($localfilename, &#039;r&#039;);
$ftp_server = &#039;ftps://&#039;.$server.&#039;/&#039;.$remotefilename; 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $ftp_server);
curl_setopt($ch, CURLOPT_USERPWD,$user.&#039;:&#039;.$pass);…</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:multi-dimensional-array-compare&amp;rev=1715901213&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-05-16T23:13:33+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Multi Dimensional Array Compare</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:multi-dimensional-array-compare&amp;rev=1715901213&amp;do=diff</link>
        <description>Multi Dimensional Array Compare

This function compares two multi dimensional arrays and returns an array containing the new, removed and changed values as separate array.


&lt;?php
function compareArrays($array1, $array2) {
    $result = [
        &#039;new&#039; =&gt; [],
        &#039;removed&#039; =&gt; [],
        &#039;changed&#039; =&gt; []
    ];

    // Check for new and changed values
    foreach ($array2 as $key =&gt; $value) {
        if (array_key_exists($key, $array1)) {
            if (is_array($value) &amp;&amp; is_array($array1[$…</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:php-analysis&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP Analysis</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:php-analysis&amp;rev=1685357735&amp;do=diff</link>
        <description>PHP Analysis

Psalm is a static analysis tool that attempts to dig into your program and find as many type-related bugs as possible.
&lt;https://github.com/vimeo/psalm&gt;
&lt;https://psalm.dev/&gt;
Most of them are from running &#039;composer psalm&#039; and &#039;composer format&#039; on the code.
&lt;https://psalm.dev/docs/running_psalm/language_server/&gt;
&lt;https://github.com/sublimelsp/LSP&gt;

&lt;https://psalm.dev/docs/running_psalm/installation/&gt;
&lt;https://github.com/vimeo/psalm&gt;

&lt;https://medium.com/@ondrejmirtes/three-pillars-of-…</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:php-fpm-logging&amp;rev=1738854988&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-06T15:16:28+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP FPM Logging</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:php-fpm-logging&amp;rev=1738854988&amp;do=diff</link>
        <description>PHP FPM Logging

PHP FPM is a separate daemon and passes its logs to apache by default and they will be included in apache logs. However, apache does not support line breaks in those logs which makes the log entries very difficult to read. To avoid this, php fpm can be configured to log into its own files instead.</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:php-mysqli&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP mysqli migration</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:php-mysqli&amp;rev=1685357735&amp;do=diff</link>
        <description>PHP mysqli migration

The mysql php extension has been deprecated after php5.4. The following functions are affected and should be replaced with the mysqli extension.

All functions require the database link as option, unless it&#039;s dealing with an existing result set.
Mysqli_connect has different options!</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:php5.6_on_debian9&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP 5.6 on Debian 9</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:php5.6_on_debian9&amp;rev=1685357735&amp;do=diff</link>
        <description>PHP 5.6 on Debian 9


sudo apt-get update
sudo apt-get install -y apt-transport-https curl
curl https://packages.sury.org/php/apt.gpg | sudo apt-key add -
echo &quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&quot; | sudo tee /etc/apt/sources.list.d/php5.list

sudo apt-get update
sudo apt-get install -y php5.6
php -v

sudo update-alternatives --config php</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:php8-debian11&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP 8 on Debian 11</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:php8-debian11&amp;rev=1685357735&amp;do=diff</link>
        <description>PHP 8 on Debian 11

PHP 8 is not available in the Debian 11 repositories and needs to be installed manually:

Add repo:


apt-get update
apt-get install ca-certificates apt-transport-https software-properties-common -y
echo &quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&quot; | tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -
apt-get update -y

apt-get install php8.0
php -v</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:phpcsfixer&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP CS Fixer</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:phpcsfixer&amp;rev=1685357735&amp;do=diff</link>
        <description>PHP CS Fixer

The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., or other community driven ones like the Symfony one. You can also define your (team&#039;s) style through configuration.</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:phplint&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHPLint</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:phplint&amp;rev=1685357735&amp;do=diff</link>
        <description>PHPLint


#!/usr/bin/env php
&lt;?php


  /**
   * Linting Command Class
   *
   * @package CodeRobot
   **/
  class Lint_Command {


    private $count   = 0;
    private $errors  = array();
    private $options = NULL;
    private $parse   = NULL;
    private $files   = FALSE;
    private $git     = NULL;


    /**
     * Command constructor
     *
     * @return void
     **/
    public function __construct() {
      $this-&gt;path  = $_SERVER[&#039;PWD&#039;];
      $this-&gt;files = $this-&gt;get_piped_files();
…</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:phpstorm&amp;rev=1742308068&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-03-18T14:27:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PhpStorm</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:phpstorm&amp;rev=1742308068&amp;do=diff</link>
        <description>PhpStorm

&lt;https://www.jetbrains.com/phpstorm/download/other.html&gt;


wget https://download.jetbrains.com/webide/PhpStorm-2023.3.3.tar.gz
tar -xvzf PhpStorm-2023.3.3.tar.gz
sudo mv sudo mv PhpStorm-233* /opt/phpstorm
/opt/phpstorm/bin/phpstorm


Add to menu and cinnamon panel launcher


cat &gt; ~/.local/share/applications/phpstorm.desktop &lt;&lt; EOD
[Desktop Entry]
Name=PhpStorm
Exec=/opt/phpstorm/bin/phpstorm
Comment=
Terminal=false
Icon=/opt/phpstorm/bin/phpstorm.png
Type=Application
EOD</description>
    </item>
    <item rdf:about="http://wuff.dyndns.org/doku.php?id=php:start&amp;rev=1685357735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-05-29T10:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP</title>
        <link>http://wuff.dyndns.org/doku.php?id=php:start&amp;rev=1685357735&amp;do=diff</link>
        <description>PHP</description>
    </item>
</rdf:RDF>
