I'm maintaining to exist project which migrated from another host.
I'm facing this issue where the image from app/media/tf/img/ are broken whereas from other path are working fine. Below are stack trace from error.log
2020-12-04 16:44:47 Error: [MissingControllerException] Controller class TransferController could not be found.
Exception Attributes: array (
'class' => 'TransferController',
'plugin' => 'Media',
)
Request URL: /xy/media/tf/img/123.jpg
Stack Trace:
#0 E:\www\xy\xy\app\webroot\index.php(92): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#1 E:\www\xy\xy\index.php(41): require('E:\\www\\xy...')
#2 {main}
Actually, from old server everything's are working fine using the exact same source code. Also, I did tried for the same workaround here but still not working.Glad if someone could help as I'm new to CakePHP.
UPDATE
Just tried to change the path app/img , it is working. It's kind of weird since media/transfer/img are in the same webroot.
img--> tried direct path(app/img/..), working
media--> tried /transfer/img/.. path, not working
manual--> tried direct path(app/manual/..), also not working
But still I need to use the media path and if any explanation for this would be highly appreciated.
Check imageBaseUrl in app.php , here we assign the folder for
$this->Html->image();
Related
Cross post from https://github.com/getgrav/grav/issues/3523
(don't kill me, I didn't know that it's frowned upon)
I am not sure if this is the place to ask for help, so tell me if it's not (and maybe where to ask).
I am trying to update to the latest Grav release 1.7.29 from (originally 1.6.24, while troubleshooting today updated to) 1.6.31 (using direct-install.
I tried updating with self-upgrade and direct-install <latestVersionURL>.
But, while trying to install, it gives me the following error:
Installing upgrade... [30-Jan-2022 17:04:37 Europe/Cityxy] PHP Fatal
error: Uncaught Error: Call to undefined method
Grav\Common\Utils::basename() in
/var/www/virtual/name/html/tmp/Grav-61f6b713f0bb9/zip/grav-update/system/src/Grav/Installer/VersionUpdate.php:29
Stack trace:
#0 /var/www/virtual/name/html/tmp/Grav-61f6b713f0bb9/zip/grav-update/system/src/Grav/Installer/VersionUpdater.php(126):
Grav\Installer\VersionUpdate->__construct('/var/www/virtua...',
Object(Grav\Installer\VersionUpdater))
#1 /var/www/virtual/name/html/tmp/Grav-61f6b713f0bb9/zip/grav-update/system/src/Grav/Installer/VersionUpdater.php(38):
Grav\Installer\VersionUpdater->loadUpdates()
#2 /var/www/virtual/name/html/tmp/Grav-61f6b713f0bb9/zip/grav-update/system/src/Grav/Installer/Install.php(239):
Grav\Installer\VersionUpdater->__construct('core/grav',
'/var/www/virtua...', '1.7.29', Object(Grav\Installer\Versions))
#3 /var/www/virtual/name/html/tmp/Grav-61f6b713f0bb9/zip/grav-update/system/src/Grav/Installer/Install.php(184):
Grav\Installer\Install->prepare()
#4 /var/www/virtual/name/html/system/src/Gra in /var/www/virtual/eduref/html/tmp/Grav-61f6b713f0bb9/zip/grav-update/system/src/Grav/Installer/VersionUpdate.php
on line 29
From my understanding the files between versions have been changed, and looking at the Grav documentation, the called method basenames() is now in Grav/Common/URI, not in Grav/Common/Utils.
So I assume I located the problem, but have no idea on fixing it. Since I am not very well versed on this whole topic of managing websites (never set up the site, only maintaining it), I would really appreciate a safe answer on how to update Grav to the newest version which doesn't risk me destroying the functioning of the website.
Thank you for helping! :)
Tried with:
PHP: 7.3 & 7.4
Grav: 1.6.24 & 1.6.31
Admin: 1.9.10
Host: Uberspace
via SSH
Particular issue fixed:
https://github.com/getgrav/grav/issues/3523
following issue open:
https://github.com/getgrav/grav/issues/3532
Hello I am trying to upload a symfony 3 project to the hosting.
The hosting php version is 7.
I am uploading It by FTP beacause I do not have SSH acces and I request to the support of the hosting, and I do not have the right acount for have SSH user.
On localhost with xamp the proyect run perfectly but when I uploaded It, the next issue apears:
Fatal error: Uncaught RuntimeException: Session Storage was not able to create directory "\app/../var/sessions/prod" in var/cache/prod/classes.php:292 Stack trace: #0 /var/cache/prod/appProdProjectContainer.php(2131): Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler->__construct('/usr/home/farma...') #1 /vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(274): appProdProjectContainer->getSession_HandlerService() #2 /var/cache/prod/appProdProjectContainer.php(2170): Symfony\Component\DependencyInjection\Container->get('session.handler') #3 /vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(274): appProdProjectContainer->getSession_Storage_Native in /vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 94
I read some problems like these on stack and I tryied change the permission of the forlders making them at 777 however It not work.
Someone know how can I solve these? Or other idea for try?
PD:
Right now looking the structure folder I saw a strange folder.
That folder is "var\logs". I can not delete It also It creates after I try inside symfony project.
On local I do not have that fodler.
Try to clear cache by this command:
bin/console cache:clear --env=prod
Or delete var/cache/ manualy
Been using the PHP Soundcloud API for some time now, and it's been working fine. The code I use to create the track array is (and has always been):
$track = json_decode($client->post('tracks', array(
'track[title]' => $title,
'track[asset_data]' => $filename,
'track[description]' => $desc,
'track[genre]' => "Podcast",
'track[artwork_data]' => $image
)));
And it's always been working just fine - until this morning, when I got this error message when uploading a track using my home-made PHP tool:
Fatal error: Uncaught exception 'Services_Soundcloud_Invalid_Http_Response_Code_Exception' with message 'The requested URL responded with HTTP code 422.' in /home/csicon/public_html/PodcastAuthor/lib/Soundcloud.php:943 Stack trace: #0 /home/csicon/public_html/PodcastAuthor/lib/Soundcloud.php(621): Services_Soundcloud->_request('https://api.sou...', Array) #1 /home/csicon/public_html/PodcastAuthor/2-publish.php(52): Services_Soundcloud->post('tracks', Array) #2 {main} thrown in /home/csicon/public_html/PodcastAuthor/lib/Soundcloud.php on line 943
Now, I'm no newb, and know what HTTP code 422 is all about, so I checked the contents of $title, $filename, $desc and $image. They are, in order:
Geekdays #274: 2015-11-17
#/home/csicon/public_html/PodcastAuthor/uploads/g274.mp3
Snowden, the FBI and the Oxford Dictionary are getting blamed for things that they may or may not have done. Also; the air you're breathing might be killing you. This, and so much more, on today's episode of Geekdays.
#/home/csicon/public_html/wp-content/uploads/2014/10/geekdays-600x600.png
All paths (to the mp3 and the image) check out, there's nothing wonky in the character set being used, and it's all worked before. What might have happened here? I'm stumped.
UPDATE! Turns out my webhost has upgraded their PHP environment from 5.4 to 5.6, and this is what broke it. What's changed between 5.4 and 5.6 that might have caused this, in that case?
Turns out my webhost has upgraded their PHP environment from 5.4 to 5.6, and this is what broke it. What's changed between 5.4 and 5.6 that might have caused this, in that case?
How cURL file uploads are handled has changed.
CURLOPT_SAFE_UPLOAD is set to true by default from PHP 5.6 on, and that means file uploads are not possible any more using the #-file path syntax, but CURLFile should be used for file uploads instead.
Try setting CURLOPT_SAFE_UPLOAD to false, using the setCurlOptions method.
Magically started working when I changed to the sebdesign/php-soundcloud version of the curl-file branch. Not sure why the "normal" curl-file branch didn't work, however.
Im getting this error randomly,i search it and it seems that this happens if you havent set an app key,the problem is i had set it from the start.The problem usually happens when i make multiple $http calls from my app it never happens from postman.
error:
[2015-10-12 16:36:11] development.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php:29 Stack trace:
0 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(733): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption{closure}(Object(Illuminate\Foundation\Application), Array)
1 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build(Object(Closure), Array)
2 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('encrypter', Array)
3 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(837): Illuminate\Foundation\Application->make('Illuminate\Cont...')
4 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
5 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(771): Illuminate\Container\Container->getDependencies(Array, Array)
6 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build('App\Http\Middle...', Array)
7 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('App\Http\Middle...', Array)
8 C:\xampp2\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(142): Illuminate\Foundation\Application->make('App\Http\Middle...')
9 C:\xampp2\htdocs\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
10 {main}
update:
ok i checked it a little more and if change the app.php
'key' => env('APP_KEY', 'someRandomString')
with my key
'key' => env('APP_KEY', 'My key')
im getting error 404 not found on the route.I think that at some point randomly fails to read the env key.It may be a problem with my resources im developing on my computer i will upload it to a server and check it again.
You should change it in your .env file, when you change the someRandomString in the env() call all you're doing is telling Laravel to use that as a default if it can't find the real app key. So Laravel is probably finding an incorrect app key and never gets to your default.
If you don't have a .env file (but you probably do, since your default failed), you should have a .env.example file that you can rename. Then you can do php artisan key:generate to generate and set it automatically.
If it still doesn't work after doing that, you have some other problem unrelated to app keys. :) Good luck!
OK i solved it the problem was my computer resources was not enough to make multiple calls after i upload to server everything works fine.
I am trying to get Smarty setup and working, so that I can install the open-source project here
http://sourceforge.net/projects/assign-calc/
After following the install instructions, I get stuck with the following error message
<b>Fatal error</b>: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/dev/calendar/skins/rpc/tmpl/page/rpc_header.tpl" on line 5 " {$application.long_name|escape}" unknown modifier "escape"' in /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php:423
Stack trace:
#0 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_compile_private_modifier.php(62): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown modifie...', 5)
#1 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php(279): Smarty_Internal_Compile_Private_Modifier->compile(Array, Object(Smarty_Internal_SmartyTemplateCompiler), Array, NULL, NULL)
#2 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php(123): Smarty_Internal_TemplateCompilerBase->callTagCompiler('private_modifie...', Array, Array)
#3 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php(68): Smarty_Internal_TemplateCompilerBase in <b>/usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php</b> on line <b>423</b><br />
After a bit of googling, I think the problem is being cause by Smarty not reading the escape modifier in the plugins directory.
How do I resolve this? I've even tried 777 the permissions on smarty, but that hasnt change anything...
Have you loaded the smarty configuration correctly? In particular, have you setted correctly the plugin path, through the command
$smarty->addPluginsDir('path/to/plugins');
?
I'm the developer of the Research Project Calculator, and found this SO question while researching the same problem for another user. The code has only been in the wild for a few weeks and we're discovering some of these things as other institutions install it.
I was able to get it running for the other user by explicitly calling parent::__construct(); before anything else in the inc/rpc_smarty.inc.php class constructor. I'll post a new release shortly, but for now you should just be able to patch that constructor as below.
Please feel free to contact me via the link in the project's installation instructions wiki page if you have more questions or run into other problems.
public function __construct($config)
{
parent::__construct();
$this->config = $config;
...
...
}
An absolute system path is the fastest and safest approach. You can use relative paths, but be certain the php include_path contains what is needed to find it. You could also use SMARTY_DIR to base your path from.