While testing the Uppy.io file uploader I struggled with some CORS-errors. Almost the whole day was wasted troubleshooting and debugging. Trying different headers, debugging network-traffic and reading stack overflow. The browser returned a CORS-error and Uppy itself returned a network traffic error. 99% of all issues and google-results pointed to an api/server issue with my headers. The weird part was …
Using Adldap2
I have been using Adldap v4.x at my work for a while now. After installing a test-server with PHP7, I found that the Adldap needed to be updated. I started with Adldap 5.x, but in the middle of the testing, it looked like the Adldap-project wasn’t maintained anymore. So I had to jump over to Adldap2, which wasn’t as straight …
Setting up external hotspot with Ubiquiti (ubnt) and debugging
My setup: Webserver: Ubuntu 16.04 with default Apache2, PHP7 and MySQL. The webserver also has a local issued certificate with HTTPS. UniFi Controller: 4.8.18 (Running on a Windows 10 client) Laptop with wireless, running Windows 10, for testing. This article will focus more on debugging than on the setup itself, as there are multiple of howto-guides everywhere on the Internet. My guest …
PHP error: child pid 1234 exit signal Segmentation fault (11)
Just wasted a couple of hours troubleshooting the PHP error: AH00052: child pid 2460 exit signal Segmentation fault (11). The browser (Google Chrome) just returned: ERR_EMPTY_RESPONSE. The /var/log/httpd/my_virtual_domain-error_log didn’t say anything. But the default /var/log/httpd/error_log printed this error [core:notice] [pid 1400] AH00052: child pid 2682 exit signal Segmentation fault (11) for every page request. The problem was actually a PHP recursive error, which …
Use PHP Composer with an existing project
I have been aware of what PHP Composer has been for a long time, but I never used it before these last days. My goal was to «install» Adldap2 and replace it with the first deprecated version. This wasn’t as straight forward as I thought, because of bad or not relevant documentation everywhere. Almost every documentation about PHP Composer shows what …
PHP snippet: Norwegian holidays
Here is a little function to find Norwegian holidays in PHP. The holidays are returned in array with Unix timestamp as key and name of the day as value.
The PHP Benchmark
Just found a PHP Benchmark page that can be helpful when writing PHP. In most cases you don’t gain much if your writing a while-loop instead of a foreach, but you can gain some in bigger applications. See PHP Benchmark results here: http://www.phpbench.com/ (Be aware that these results are live, so they will change in every refresh).
Tutorial: Install phpDocumentor
I followed the tutorial on phpdoc.org: http://phpdoc.org/docs/latest/getting-started/installing.html#system-requirements. The phpdoc.org documentation isn’t exactly a beginners tutorial, so I wrote this tutorial for my self and others benifits 🙂 CentOS Server is used in this tutorial! Requirements are PHP 5.3.3 Intl extension for PHP Graphviz To check for your PHP version, type the following in SSH: To install Intl extension for PHP, type …
Nyttige lenker ved webutvikling
Starte med webutvikling? Video Treehouse Treehouse har video-kurs med både tekstbaserte- og kode oppgaver. Lenke: https://teamtreehouse.com/ Pris: $25 hver måned Språk: Engelsk W3Cschools Denne siden kan du både bruke som referanse for å finne ut hva ting er for noe, gå gjennom enkle leksjoner, samt prøve kodesnutter. Lenke: http://www.w3schools.com/ Pris: Gratis Språk: Engelsk YouTube, «Hjemmeside» Deler: HTML / CSS Hvordan kode HTML …