dmcloud (daily motion) CloudKey_RPCException being thrown on prod environment on upload - php

The error below only occurs when I upload my code to the server. When I'm on my local development environment works perfectly. My local is Windows and my Production is Linux.
What does this mean? What should I do to solve it?
Fatal error: Uncaught exception 'CloudKey_RPCException' with message 'You must provide an url for mp4_h264_aac' in /var/www/application/libraries/CloudKey.php:336 Stack trace: #0 /var/www/application/libraries/VideoUploader.php(56): CloudKey_Api->__call('create', Array) #1 /var/www/application/libraries/VideoUploader.php(56): CloudKey_Media->create(Array) #2 /var/www/application/controllers/Admin.php(519): VideoUploader->upload(Array, Array, '06d88cc1721cbe1...') #3 [internal function]: Admin->videos('upload') #4 /var/www/system/core/CodeIgniter.php(356): call_user_func_array(Array, Array) #5 /var/www/public/index.php(274): require_once('/var/www/system...') #6 {main} thrown in /var/www/application/libraries/CloudKey.php on line 336

Ok, in case anyone ever needs this. The problem is that, I was using the $_FILES['file']['tmp_name'] directly into DMCloud method. Turns out that on Windows, it's something like C:\temp\file.tmp and on linux is something like /tmp/file. DMCloud api requires that the file used for upload must have an extension.
So, it failed to upload the file, and when I tried to use the URL of the failed upload, it gaveme this exception.
I hope someone fin this hopeful in the future =)

Related

How to add new apps folder in Yii2 advanced

I start install Yii 2 with yii-advanced-app-2.0.11.tgz archive. After unpacking and init, i have run successful Yii 2 advanced. In folder project, i see backend and frontend application.
Now, i wanna create clinic application is here. Yii 2 can do it?. I search google, but can't find solution.
backend & frontend
clinic (How can do it?)
and then I copy frontend directories and name it "clinic" then replace all words "frontend" to "clinic". but I get error like this:
An Error occurred while handling another error:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' in R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Module.php:532
Stack trace:
#0 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\web\ErrorHandler.php(95): yii\base\Module->runAction('site/error')
#1 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#2 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#3 {main}
Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "".' in R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Module.php:532
Stack trace:
#0 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\web\Application.php(102): yii\base\Module->runAction('', Array)
#1 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 R:\xampp-1-8\htdocs\berobat.id\klinik\web\index.php(17): yii\base\Application->run()
#3 {main}
Next exception 'yii\web\NotFoundHttpException' with message 'Page not found.' in R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\web\Application.php:114
Stack trace:
#0 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 R:\xampp-1-8\htdocs\berobat.id\klinik\web\index.php(17): yii\base\Application->run()
#2 {main}
in my perception, this is about setting config namespaceController="clinic/controllers", when I change it to "frontend/controller" this error exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' not showing anymore, but you know, if still in this config, my clinic apps will load frontend controller. So what should I do? Help me please!. Thanks so much!.
Add your clinic alias in common/config/bootstrap.php file like below and update all frontend namespaces in your clinic folder with newly added alias word.
Yii::setAlias('#clinic', dirname(dirname(__DIR__)).'/clinic');

mySQL Error while migrating WordPress Website locally

I am trying to migrate a live WordPress site to my localhost environment. And I believe that the PHP version on current hosting server is higher than my localhost environment version, which is causing some issue while migrating. As I don't know much about SQL code as well as how to interpret the error log, can you guide me on what I should be doing to rectify the error?
Followed is the error message I am getting:
Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in C:\xampp\htdocs\shag\wp-content\themes\twentyseventeen\functions.php:60
Stack trace:
#0 C:\xampp\htdocs\shag\wp-settings.php(425): include()
#1 C:\xampp\htdocs\shag\wp-config.php(89): require_once('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\shag\wp-load.php(37): require_once('C:\\xampp\\htdocs...')
#3 C:\xampp\htdocs\shag\wp-blog-header.php(13): require_once('C:\\xampp\\htdocs...')
#4 C:\xampp\htdocs\shag\index.php(17): require('C:\\xampp\\htdocs...')
#5 {main} thrown in C:\xampp\htdocs\shag\wp-content\themes\twentyseventeen\functions.php on line 60
define('WP_USE_EXT_MYSQL', true);
Would you please define above code in your wp-config.php? And check it. I think it's helpful for you.

Phalcon PHP - Controller handler class cannot be loaded

I have an application written in Phalcon 2. This application runs locally normally, everything works. My problem is to make it run on an Amazon Ec2 Linux server. Some controllers work normally, the routes are OK.
My problem is with some controller inside the admin area. Not all controllers give me errors, some work. This is the error I get:
AdminproductController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('AdminproductCon...', 2)
#1 [internal function]: Phalcon\Dispatcher->_dispatch()
#2 [internal function]: Phalcon\Dispatcher->dispatch()
#3 /var/www/html/public/index.php(31): Phalcon\Mvc\Application->handle()
#4 {main}
I've been reading about this error on Phalcon's forum and so far none of the answers solve my issue yet. What I'm trying to do is check if it is a case sensitive problem. But no matter what I do, the controller never loads and the error messages are always the same.
Would you have some tips, like steps or a checklist, for me to follow to try to fix this issue?
Maybe AdminproductController must be called AdminProductController or a class file was renamed and you have to change the usage of the class. Also read #Timothy's comments.

How do I stop the "Class log cannot be found" error from occurring in laravel?

I just moved my website to a separate server in an attempt to make sure that when I push the site to the production server everything transitions smoothly. Unfortunately, the site appears blank when I visit the link unless I add something like "echo 'hello';" to the index.php page, nothing is being logged in the laravel storage files (even though the permissions are recursively set to 777), and I get this error:
nickstaging#ubuntuStaging:/var/www/html/almost_acceptable$ php artisan config:cache
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var
/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
I cannot, for the life of me, figure out why it's occurring. It is recorded in the apache log file on the server. The site still runs correctly on my local homestead vm that I have running for general testing, and I tried reuploading all of the files to the server but nothing has worked.
If anyone has any idea why this is occurring, that would be great and I would very much appreciate it! Thanks in advance!
Edit
Installing php-mysql did not fix the problem and there was no difference in the error afterwards.
The most common problem is either you have spaces in your .env file or a wrong value in one of your config files.
More info here:
https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist

Error pushing code to IRON.io using PHP

I'm trying to push a zip file to iron.io using PHP with cURL but I always get this error.
-My teammates are able to do it, and I do the same, but that exception is generated.
Have someone had the same error or problem? any ideas ? I'm kind of desperate thanks
API POST: 'https://worker-aws-us-east-1.iron.io:443/2/projects/560c4ef63dc302XXXXXXX/codes'
<br />
<b>Fatal error</b>: Uncaught exception 'Http_Exception' with message 'http error: 400 | {"msg":"Code package zip file required if no image specified or using iron/images."}' in /Applications/MAMP/htdocs/www/application/libraries/ironmq/IronCore.class.php:352
Stack trace:
#0 /Applications/MAMP/htdocs/www/application/libraries/ironmq/IronCore.class.php(343): IronCore->reportHttpError(400, '{"msg":"Code pa...')
#1 /Applications/MAMP/htdocs/www/application/libraries/ironmq/IronCore.class.php(305): IronCore->callWithRetries()
#2 /Applications/MAMP/htdocs/www/application/libraries/ironworker/IronWorker.class.php(303): IronCore->apiCall('POST', 'projects/560c4e...', Array, Array)
#3 /Applications/MAMP/htdocs/www/application/libraries/ironworker/CIWorker.php(61): IronWorker->postCode('ironio.php', '/Applications/M...', 'lumiary-stage')
#4 /Applications/MAMP/htdocs/www/application/controllers/admin/tools.php(52): CIWorker->package('lumiary-stage')
#5 [internal function]: Tools->package('lumiary-stage')
#6 /Applications/MAMP/htdocs/www/sy in <b>/Applications/MAMP/htdocs/www/application/libraries/ironmq/IronCore.class.php</b> on line <b>352</b><br />
Your request is malformed (400 status code means Bad Request). You also get an explanation in the error description: Code package zip file required if no image specified or using iron/images.
The final solution was to change my PHP Version. I moved from 5.6 to 5.4 and that did the difference and everything worked as expected.

Categories