So it is pretty easy to include relationships on models such as: when there’s a get request to the user resource, it will include associated roles automagically. But in this setup, the role resources returned with user resource also includes it’s own included relationships like: This generates hug…
Remove .php from URL
Ubuntu 14.04LTS 32bit LAMP I know it’s an old question but.. I need it to remove .php anywhere it finds it from the visible url. It needs to work with /showthread.php?id=XX —> /showthread?id=XX …
Make error for OpenSSL when compiling PHP from source
I’ve attempted compiling both PHP 5.3.10 and 5.6.7 from source on Ubuntu Hardy x86_64 (I know, it’s old). Below is the configure statement I used: But am getting an issue when issuing the make command: This works perfectly fine and I can compile/make/make install when I do not include the –w…
ZF2 Doctrine2 repository result as array
I have the problem, that I have two controllers. One is a restful controller which only handles json data and returns a JsonModel, and the other one is a default controller which returns a ViewModel Now I have the problem, that my method only returns an array of entities, which is correct for the default cont…
SQLite3 (PHP Fatal error: Call to a member function exec())
I’ve been innstall and add conf: I have installed the necessary components and added to the configuration file line, maybe in php.ini need to add something? Answer Unless Im missing something your protected $_db may never get set so you cannot call exec() on null. It will never get set if this does not …
Decode JSON after POST in textarea
I am having an issue decoding a JSON string with PHP and I’m pretty sure I know what is causing it, but not sure how to fix it. I am putting an array that I convert to JSON into a hidden textarea and …
How to keep the previous uploaded image (in db) after submitting a form without selecting a new image to be uploaded
I have a simple form for creating an article: Title,image,category,body , etc.. My problem is with the image input. Selecting a new one and submitting everything works fine: the image is being uploaded to the server the title of the image is being saved to db and i can print it in the article. By editing the …
Laravel 5 and PHPMailer
Does anybody have a working example how I can work with PHPMailer in Laravel 5? In Laravel 4 it was quiet simple to use but the same method doesn’t work in L5. Here it is what I did in L4: Added in …
While loops for server-sent events are causing page to freeze
I am currently working on a chat that uses Server-Sent Events to receive the messages. However, I am running into a problem. The server-sent event never connects and stays at pending because the page doesn’t load. For example: I expect that every 3 seconds, “data: This is the message.” will …
How to get Doctrine to log queries in Symfony2
I’m pretty new to Symfony2, and I’m looking for a way to log SQL queries (including timings) to the same log file as the rest of my application. From what I can determine from the documentation this should all work out of the box, but after a few hours of trying I can’t figure out what IR…