I’m running PHP 5.4 on CentOS 7 and when there is a php file that throws an error (either an exception, or a syntax error) it returns an HTTP 200 status code instead of 500. How can I get it to return a 500 server error when PHP encounters an error? I’ve tried looking at other Stackoverflow posts,…
How to get file URL using Storage facade in laravel 5?
I’ve been experimenting using the new Flysystem integration with Laravel 5. I am storing ‘localised’ paths to the DB, and getting the Storage facade to complete the path. For example I store screenshots/1.jpg and using or I can retrieve the same file on different disks. get retrieves the fil…
wordpress permalink redirect to home page if there have any unicode characters
i have a client who recently change his host server and face a werid problem. i belive it’s all happend for unicode characters. Ex: http://example.com/wp-content/uploads/2014/07/dog-meghivo-430×430….
How to use class methods as callbacks
I have a class with methods that I want to use as callbacks. How can I pass them as arguments? Answer Check the callable manual to see all the different ways to pass a function as a callback. I copied that manual here and added some examples of each approach based on your scenario. Callable A PHP function is …
PHP Warning: file_get_contents(http://ipecho.net/plain): failed to open stream: Connection timed out in
I have an error here and I don’t know where the problem is exactly. I am trying to make a PHP file and deny anyone to use the script except the IP that I have entered into the code: When I use the code Ii have problem Answer Why you use that site for getting the client’s IP? You can
Download images from html and keep the folder structure
I need to have download over 100.000 pictures. The Pictures have : .png, .jpg, .jpeg, .gif format. I have the approval to use those pictures. they have provide me an XML file with all the url`s The url have the structure otherdomain/productimages/code/imagename.jpg/.png/.gif I have all the codes in an php arr…
Eloquent attach/detach/sync fires any event?
I have a laravel project, and I need to make some calculations immediately after I save a model and attach some data to it. Is there any event that is triggered in laravel after calling attach (or …
$_FILES to a resource – Laravel 5 and Dropbox
Well, I’ve uploaded an app to Heroku, and I’ve discovered that I can’t upload files to it. Then I started to use Dropbox as storage option, and I’ve done a few tests, of send and retrieve link, and all worked fine. Now, the problem is to use the uploadFile() method on DropboxAdapter. H…
Use proxy to connect to a mysql db through PDO
I’m trying to connect to a remote mysql database with PHP PDO (php version 5.3) and I need it to go through a proxy. My connection looks like this right now. I’dd need it to go through a proxy, like http://proxy.mydomain.com:port I’ve searched through the PDO Doc and can’t seem to find…
Api versioning in laravel: routing depending on the “Accept” Header
Since I want to fire endpoints upon accept header, I created a middleware to identify which version is using the client: // ApiVersionMiddleware public function handle($request, Closure $next) { …