Posts Categorized: php

Laravel Quick Start

Quick reminder of steps to setup a Laravel project on Ubuntu/Linux Mint and similar. First install composer:

Install PHP dependencies:

  Use composer to create your Laravel project:

Install composer.json packages:

Generate a key for your new project into the .env file:

Amend the .env file with database details and anything else you want to customise. You may want to install mysql with

Auth Scaffolding Create the login and… Read more »

Bleeding Edge PHP on CentOS 7

The PHP packages in the base / epel repositories are very conservative. To opt for something more current the REMI repo can be used. Install the remi-release package (info)  first:

This will create the remi specific repo files in the /etc/yum.repo.d directory, specifically:

To install later PHP versions alongside your current PHP version… Read more »

Deploying a Web Project from Gitlab

gitlab deploy hooks

I wanted to automatically deploy a web project when any updates are pushed to the gitlab repository. To do so I added a ‘Web Hook’. The Web Hook calls a URL in response to ‘push’ events. I created a PHP page to be called by the Web Hook: So in response to push events gitlab_hook.php… Read more »

PHP Built-In Web Server

LAMP Development just got a little easier with PHP version 5.4 and the in-built PHP web server. To test a PHP application we can now navigate to the directory on the filesytem:

Then run the PHP Web Server:

In a web browser enter the location http://localhost:8000 to see your web application. The image… Read more »

Set Default Theme in phpMyAdmin on CentOS

phpmyadmin

I have installed phpMyAdmin on CentOS 6 via the EPEL repository using:

I was asked to set the default theme from the new jazzy one to the traditional one. To do so I edited the phpMyAdmin config file. On CentOS this was at /etc/phpMyAdmin/config.inc.php but on other installations it may be under /usr/share/phpMyAdmin

Read more »

Unlocking Active Directory Accounts using LDAP

I am using PHP with LDAP to manage some aspects of user accounts within Active Directory. One of the things I needed to do was to reset the accounts of users who had incorrectly entered their password too many times. Initially I thought that the ‘useraccountcontrol’ field was what I needed as this is used… Read more »

LDAPS Active Directory Issues with php-5.3.3-27.el6_5.2.x86_64

I upgraded a CentOS server today updating PHP from

to

This stopped a PHP web application I had written from being able to communicate with Active Directory over LDAPS. Normal LDAP appears to continue working fine but when I change my connections back to ldaps they stop working. To deal with the problem… Read more »

Retrieving folder.jpg thumbnails: PHP Script

When using XBMC we usually use the ‘Files’ menu. The folder icons under ‘Files’ do not show a preview thumbnail unless there is an image in the folder named ‘folder.jpg’. I could manually search for folder images for each movie but decided that would be time-consuming so I put together a wee PHP script –… Read more »

PHP Accessing an IMAP Mailbox

This week I started playing around with PHP and a honeypot mailbox I had created some time ago. The following PHP is what I have been using thus far – plenty more work to do:  

 

Fail2Ban Custom Action

I decided to experiment with creating a central database to hold the IP addresses banned by various servers / honeypots running Fail2Ban – so that the information could be used as a source for IPtables or TCPWrappers to protect other servers. I created the file /etc/fail2ban/action.d/qshield.conf and in it placed the following:

Then editied… Read more »