Let’s say I have a video on a remote server and this its url “http://domain/video-path/video.mp4” What is the correct way to stream this video using php with seekable.. I know how to stream the …
Tag: php
How to add main menu url with a url instead of slug in wordpress?
I have used the following function to add menu in wordpress admin backend. But i cant able to add url eg: http://www.google.com in menu href any solution for this ? Answer The short answer is that this is not possible to do using the add_menu_page() function. Probably for good reason, WordPress does not allow…
Clickhouse connection refuse
I have a problem with connection to clickhouse-server by http over 8123 port. All parameters are default. Please help me to resolve this problem. Answer First of all check if even you clickhouse-server is running properly or not using this command: sudo lsof -i :8123 You should be able to see a similar output…
Convert � � to Emoji in HTML using PHP
We have a bunch of surrogate pair (or 2-byte utf8?) characters such as �� which is the prayer hands emojis stored as UTF8 as 2 characters. When rendered in a browser this string renders as two ?? example: I need to convert those to the hands emjoi using php but I simply cannot find a com…
Laravel 5.4 relative instead of absolute 302 redirects
I’m having issues with a new Laravel app behind a load balancer. I would like to have Laravel do the Auth middleware 302 redirects to relative path like /login instead of the http://myappdomain.com/login is actually doing. I only see 301 redirects in the default .htaccess Laravel ships which makes me be…
What’s the difference between xdebug.ini and php.ini
Recently I installed lamp and php-xdebug on an ubuntu 16.04 box. I noticed that now I have the following files /etc/php/7.0/apache2/conf.d/20-xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini /etc/…
PHP binding method to another class
Can i bind method of class Foo to class Bar? And why the code below throws a warning “Cannot bind method Foo::say() to object of class Bar”? With function instead of method code works fine. P.S. I know about extending) it is not practical question, just want to know is it real to bind non-static m…
How to run 2 or more input files in the same form with PHP
I would like to know how to run 2 or more input files in the same form, I have to upload some documents by using php, I made separate forms and they work, but I need to all together however I dont know how. I need to put only two forms as example actually I need to put 3 but
Upgrade PHP on AWS Linux
I have an AWS server running a website with NGINX and PHP. I originally installed these using the following: sudo yum install -y nginx php-fpm The version of PHP that is installed is 5.3.29 which but I need at least 5.4 to run a payments plug-in. All the info online indicates a PHP upgrade actually involves a…
Insert null or something if value of csv is null
I have a problem uploading a csv to mysql. I have the following csv. I need to upload the marked fields the max fields the csv can contain are 48 but some csv contain only 36 or less. I have a form which if csv contains 48 cells uploads succesfully to mysql but if the csv is less than 48