Stuff I'm Up To

Technical Ramblings

Composer Require Specific Branch — June 4, 2018

Composer Require Specific Branch

I’m trying to test out a version of a SAML project that doesn’t include the now defunct php extension for mcrypt. Using composer require kept on grabbing the master branch, when I actually wanted the “remove_mcrypt” branch.

I found that using composer with the branch like this failed:

$ composer require "aacotroneo/laravel-saml2":"remove_mcrypt"

[UnexpectedValueException]
Could not parse version constraint remove_mcrypt: Invalid version string “remove_mcrypt”

Thanks to a stackoverflow post: https://stackoverflow.com/questions/33525885/composer-require-branch-name I was able to resolve it by correctly prefixing the branch with “dev-

$ composer require "aacotroneo/laravel-saml2":"dev-remove_mcrypt"
Advertisements
Laravel 5 – jQuery File Upload — February 22, 2018

Laravel 5 – jQuery File Upload

I needed a mechanism to upload CSV files to my Laravel instance and then process them into a table. The first part was working out how I wanted to upload the files.

I came across blueimp-file-upload which seems pretty popular and capable.

There was no need to go overly fancy. Just a simple form will do as the file will probably be uploaded as a single file. First I had to figure out how to get blueimp into Laravel.

Continue reading

PHP7.0, Microsoft SQL Driver & Debian (stretch) — December 12, 2017

PHP7.0, Microsoft SQL Driver & Debian (stretch)

What a mission today has been. I think I’ll ultimately roll back to using Debian Jessie as Stretch isn’t a supported system, yet.

To get the MS SQL ODBC driver working even in Jessie appears to be a challenge. In Stretch I almost surrendered. It is working, but I do think it’s a bit of a hack as I’ve had to install an older libssl1.0.0 and enable the locale en_US.UTF-8.

PHP development voted out the inclusion of MS SQL to the project so now you must compile and install it yourself. There are some very good instructions out there to help you – even from Microsoft.

https://docs.microsoft.com/en-gb/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

Continue reading

Laravel & PHP Minimum Requirements — December 11, 2017

Laravel & PHP Minimum Requirements

Make sure you’ve installed php and the necessary modules before trying to create a new Laravel project.

$ sudo apt-get install php-fpm
$ sudo apt-get install php-mbstring php-zip

The order of php-fpm and php is important as putting them the other way around you’ll find you get apache2 installed when you probably don’t want that.

Then you should be able to create your empty project using composer without any complaints.

$ cd /var/www
$ composer create-project --prefer-dist laravel/laravel [project]

 

Owncloud Upgrade and Maintenance Mode — May 22, 2017
ownCloud — September 20, 2016

ownCloud

We needed a semi-secure method of transferring files between staff and 3rd parties. To handle those frequent times when someone tries to attach a 150MB file onto an email. OwnCloud to the rescue.

It’s come a long way since I first used it. Now it has all kinds of plugins and features. What’s good about it is there are clients for pretty much all platforms – many free. Failing that good old HTML will do.

Continue reading

NGINX and php5-fpm —

NGINX and php5-fpm

This new version of NGINX is tending to be a bit of a pain in terms of installation. Gone are the sites-available and sites-enabled folders and it does a couple of things during installation that really grips my goat.

Getting php5-fpm working with it needs some manipulation of the config. The site configs are now located under /etc/nginx/conf.d/ and they now have a .conf extension. The default being default.conf.

By default this config sticks the ‘root’ directive under the location /. Which when it comes to running php5-fpm and using fastcgi parameters causes a headache. It’s a simple fix, but put simply the previous use of $document_root will not work because the directive needs to be within the server context NOT location.

Continue reading

tobscure/json-api — September 17, 2016
PHP Frameworks & Dependencies — September 14, 2016

PHP Frameworks & Dependencies

I’m not new to PHP and have used it quite often, but what I’ve not really used are frameworks. There are plenty of them out there all capable of different things, but all able to save a whole heap of time when it comes to developing something more than a simple script.

The one I’ve tended to favour is ‘Laravel‘. It’s pretty fully featured and fairly straight forward, but there is a lot to learn.

But what it did do for me was introduce me to composer.phar and then on to Packagist.

Continue reading