php

Intelephense squiggly line under function

Adding a missing function definition Using the VS Code Intelephense Extension. You get a squiggly line under a function you know exists. When you hover over it the popup says "Undefined function ... " Go to Preferences and Settings [ Ctrl + , ], search for stubs and...

How to enable ZipArchive on PHP 7.4

Ubuntu / Debian Find the extension version you want to install # install apt-get install php7.4-zip # enable it phpenmod -v 7.4 zip # check it is enabled php7.4 -i | grep -i zip # restart any services such as php7.4-fpm.service to pick up the change systemctl restart...

Using a git repo as a composer repository

So here is the link so I don't forget it https://getcomposer.org/doc/05-repositories.md#vcs Add your repo's URL into your composer.json in the repositories key and change the version on the original repo name to your dev-* version where * is a branch of your github...

PHP Version Gotcha

Just copied some code from a PHP 7.3+ development environment to the server running PHP 7.2 On the server I am getting this On PHP 7.3 it runs fine Because the line number is not listed this is how I find the problem Find which controller is being called when you see...

Netbeans Removes Indent from // Comments

Been using netbeans for PHP development and discovered that it will remove the leading whitespace from comments and then the comments inside a block of code are hard up against the left margin which looks weird. Not sure if there is a setting to stop this behaviour...

I have no idea what the problem is PHP CLI

Trying to do some PHP tutorials using vim and running php from the command line and I get.... nothing back. If it's a syntax error (e.g. a missing line ending ; ) then no reply at all. If the syntax is correct and it's something else then the error isn't displayed...

CakePHP 3 – Escape to the Global Namespace

This code in CakePHP 3: <?php $date = '31/01/1973'; $ymd = DateTime::createFromFormat('!d/m/Y', $date)->format('Y-m-d'); Causes this error Error: Class 'App\Controller\DateTime' not found This code fixes it: <?php $date = '31/01/1973'; $ymd =...

XML POST Proxy Script using PHP and libcurl

This is the simplest answer I could find for a client needing to POST an XML SOAP message to a server in another domain. Not sure on the security because the POST isn't validated so it just passes on whatever the client sends. libcurl has a lot of options

Maitland Waterproofing

I have just finished coding a website for a friend. He's running a Waterproofing business. I got him to do the waterproofing in my bathroom renovation, which he did a great job of. I was amazed at how neat the end result was (he used these cute little plastic dishes...