ever heard of PSR? (PHP Standard Recommendations are like RFCs)

no? Nevermind.

some devs make jokes about PHP – but this – only PHP + XDEBUG can do!

  • setup a test-server with test requests and data and start debug session with the REAL requests that start a debug-session in eclipse to look into the code step-debugging what is going on-and-wrong and find the problem with this particular input
    • python can only do this for files, not requests (also python is slower)
  • develop DIRECTLY on this test-server
    • then git commit git pull aka sync-copy results to production

“show me the src”: https://github.com/xdebug/xdebug

how to set it up?

some find it hard to setup and it can be a bit tricky, so prepared a ready2go virtualbox disk images (3.2GB download).

support the software:

so the software can support the developer, so the developer can support the user:

“where does the money go?” wow look at this: https://xdebug.org/log

really would wish every project had this kind of transparency 😀

PS: DEFINATELY DISABLE OPCACHE DURING DEVELOPMENT! X-D “why does this variable have values from yesterday?” “strange” (it was OPCACHED)

# where are the config files?
# 1) way look: info.php

echo '<?php phpinfo();' > /var/www/html/info.php
# open info.php in browser and Ctrl+F search for php.ini

# 2) way:
php --ini
Configuration File (php.ini) Path: /etc/php/8.1/cli
Loaded Configuration File:         /etc/php/8.1/cli/php.ini
Scan for additional .ini files in: /etc/php/8.1/cli/conf.d
Additional .ini files parsed:      /etc/php/8.1/cli/conf.d/10-mysqlnd.ini,
/etc/php/8.1/cli/conf.d/10-opcache.ini,
/etc/php/8.1/cli/conf.d/10-pdo.ini,
/etc/php/8.1/cli/conf.d/15-xml.ini,
/etc/php/8.1/cli/conf.d/20-bcmath.ini,
/etc/php/8.1/cli/conf.d/20-calendar.ini,
/etc/php/8.1/cli/conf.d/20-ctype.ini,
/etc/php/8.1/cli/conf.d/20-curl.ini,
/etc/php/8.1/cli/conf.d/20-dom.ini,
/etc/php/8.1/cli/conf.d/20-exif.ini,
/etc/php/8.1/cli/conf.d/20-ffi.ini,
/etc/php/8.1/cli/conf.d/20-fileinfo.ini,
/etc/php/8.1/cli/conf.d/20-ftp.ini,
/etc/php/8.1/cli/conf.d/20-gd.ini,
/etc/php/8.1/cli/conf.d/20-gettext.ini,
/etc/php/8.1/cli/conf.d/20-iconv.ini,
/etc/php/8.1/cli/conf.d/20-imagick.ini,
/etc/php/8.1/cli/conf.d/20-imap.ini,
/etc/php/8.1/cli/conf.d/20-intl.ini,
/etc/php/8.1/cli/conf.d/20-mbstring.ini,
/etc/php/8.1/cli/conf.d/20-memcache.ini,
/etc/php/8.1/cli/conf.d/20-mysqli.ini,
/etc/php/8.1/cli/conf.d/20-pdo_mysql.ini,
/etc/php/8.1/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/8.1/cli/conf.d/20-phar.ini,
/etc/php/8.1/cli/conf.d/20-posix.ini,
/etc/php/8.1/cli/conf.d/20-pspell.ini,
/etc/php/8.1/cli/conf.d/20-readline.ini,
/etc/php/8.1/cli/conf.d/20-shmop.ini,
/etc/php/8.1/cli/conf.d/20-simplexml.ini,
/etc/php/8.1/cli/conf.d/20-sockets.ini,
/etc/php/8.1/cli/conf.d/20-sqlite3.ini,
/etc/php/8.1/cli/conf.d/20-sysvmsg.ini,
/etc/php/8.1/cli/conf.d/20-sysvsem.ini,
/etc/php/8.1/cli/conf.d/20-sysvshm.ini,
/etc/php/8.1/cli/conf.d/20-tidy.ini,
/etc/php/8.1/cli/conf.d/20-tokenizer.ini,
/etc/php/8.1/cli/conf.d/20-xdebug.ini,
/etc/php/8.1/cli/conf.d/20-xmlreader.ini,
/etc/php/8.1/cli/conf.d/20-xmlrpc.ini,
/etc/php/8.1/cli/conf.d/20-xmlwriter.ini,
/etc/php/8.1/cli/conf.d/20-xsl.ini,
/etc/php/8.1/cli/conf.d/20-zip.ini

from user to dev:

  • the positive:
    • php is easy to learn
    • php is usually “fast enough” (for web backends: it is slower than java but faster than python, but java needs A LOT more RAM)
  • the critique:
    • php related environments might be a wee bit complicated to setup
  • if the user wants to become a php dev check out bro’s excellent fun and easy php examples 🙂
    • just4info:
      • all those fancy php frameworks symphony sometime consisting of more than 10.000 files (thanks for making it open source but that’s a wee bit against unix kiss)
      • are just libraries that a dev wrote to use it, and while it HIGHLY might advance the user-soon-php-dev php-related-career they are NOT REQUIRED to get started, also:
        • if the user-soon-php-dev writes libraries + uses xdebug, the user-soon-php-dev is the only one who REALLY understands whats going on “under the hood” why things work or fail

keep it up and running:

 

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin