Laravel Class 'Memcached' not found Illuminate\Cache\MemcachedConnector.php line 44 - php

I've just clone my git repo from BitBucket on my computer to refresh my sites directory, and attempted a composer install/update to bring myself back up to scratch.
I'm now faced with:
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Memcached' not found","file":"\/Users\/Ed\/Sites\/metinet_api\/vendor\/laravel\/framework\/src\/Illuminate\/Cache\/MemcachedConnector.php","line":44}}Script php artisan clear-compiled handling the post-update-cmd event returned with an error
This was working before the fresh clone, and caching with tags (Memcached) is hard coded into my application, so it would not be ideal to use a different driver.
I'm using an OS X machine.
Can anyone suggest a solution? Many thanks, Ed

The class Memcached is not a Laravel class — it's a PHP class provided by a PHP extension. Your OS X machine doesn't have the PHP Memcached extension installed. Get that installed (with a memcached server backing it) and you'll be good to go.
If you're not up for homebrewing this yourself, then this package has always been my defacto go to on OS X to get most of the goodies a modern PHP developer will need. You could also consider abandoning running your stack locally and give in to Vagrant (running *nix VMs locally will your installed software)

If you've just cloned your repo you probably need to run composer update to get all of your dependencies? I'm guessing your vendor/ folder is empty right now, its certainly missing the memcached class
Cheers
Ash Finlayson

Related

Symfony configuration problems - not recognizing symfony as an command

I have a problem with symfony configuration. I installed symfony and configure everything as in tutorials, but i can't start server in my project file, because i've got that kind of error :
'symfony' is not recognized as an internal or external command,
operable program or batch file.
I tried to reinstall whole packet and I'm still geting same result. What I need to reconfigure or change?
You must install the Symfony CLI (the symfony binary) separately from the libraries/bundles/packages.
See the Symfony CLI installation instructions for more information.
This is typically done first, so your answer makes it unclear how you may have "installed symfony". If you indeed installed the CLI, you may have to take additional steps to make it globally available depending on your platform.

php artisan optimize times out only on composer install

I'm running a laravel app on Azure. Things are moving in the right direction, composer install didn't use to work at all. Now however, the "php artisan optimize" command times out:
However, running "php artisan optimize" separately is no problem at all:
What could be the cause of this?
Edit:
Deleting the symfony-folder does not help, it is not present when I run the "Composer install"-command:
Increasing the timeout-limit does not help either, I increased it in both azure and in the composer.json file:
This still gives me a timeout, after installing the symfony-components again:
...
As I deployed a new clean Laravel 5 application to Azure Web apps and tried to reproduce your issue, however, it worked fine on my side either I run the command php artisan optimize or composer install or composer update.
I installed the composer at the Site extensions at the KUDU console site of the application on Azure Web apps, the url should be like: https://<your_site_name>.scm.azurewebsites.net/SiteExtensions/#gallery
There are several solutions of other developers who occur the same issue with you, you can try these solutions:
try to increase the max_execution_time or set the value to 0, refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations to change the PHP build-in configurations on Azure Web Apps. And you can change the process-timeout in Composer.json file :
"config" : {
"process-timeout": 0
}
deleted the entire Symfony folder and try again. As the comments at PHP Artisan Optimize - Timed out? #1050, it seems the symfony dependencies raise the issue.
#Rkey,
According to my experience, I think the issue is more related to the symphony version/configuration. I suggest you can remove/edit the symphony configuration from the composer.lock file (NOTE: please backup this file if you cannot success, you also can recovery your environment). And then you can run this "composer install".
After installed component, You can see an alert window which shows that
your session is timeout, please refresh your browser.
You can see this information because the server is in initialization process.
Any concerns, please feel free to let me know.
I'm also having this problem. Will upgrading the plan help?
According to this upgrading to S3 helps... I haven't tried it though... Let me know if it really works.
#Rkey & #cabs, per my understanding on this question, I wanna point out that Composer is not fully supported on Azure. The issue is that it’s using Taskkill command which is blocked on Azure. We are aware of this and please feel free to submit an idea or suggestion based on the experience with Azure at https://feedback.azure.com/forums/34192--general-feedback.
I have been stuck in this problem as well for a week.
Have tried all solutions on forum but no success.
This morning finally solved after reinstall XAMPP. It was problem on my previous PHP version 5.6.19. While using new XAMPP with PHP version 5.6.28, it worked fine.

How to Deploy a Cake PHP App

I wonder if someone can help me. I've been handed in a Cake PHP app that I need to 1) add minor changes 2) deploy. I've never really worked with Cake before and was wondering whether do I need to anything in order for it to work?
For instance, With a Node app, you need to install modules npm install. With a Rails app you'll likely need to install the gems bundle install.
Is there something similar with Cake? I've set the localhost server, but when I try to access the url I get all sort of errors. Some I've fixed (missing environment settings which I just override the Redis host and port). The latest one is:
{
"exception":{
"class":"MissingControllerException",
"code":404,
"message":"Controller class Controller could not be found.",
"file":"\/Library\/WebServer\/Documents\/php\/oompbe\/vendors\/cakephp\/lib\/Cake\/Routing\/Dispatcher.php",
"line":154,
"trace":[
"#0 \.../app\/webroot\/index.php(109): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))",
"#1 {main}"
]
}
}
PS: What's up with all the crazy \/\/?
PPS: Can I find out the version Cake I'm running?
CakePHP is just php. As most properly done php apps these days it comes with composer. I recommend you to read at least the basics of it's manual. Composer is an awesome tool.
git clone <repo>
cd <reponame>
composer install
If you start a new Cake application the official documentation tells you how to this as well:
composer create-project --prefer-dist cakephp/app [app_name]
If you want to automate things further composer provides you callback scripts. They'll allow you to automate tasks, basically trigger commands, after different actions. This is pretty useful to build assets after a composer update for example. I recommend you to not put lots of commands into that section but instead have dedicated script files you trigger by the callbacks.
Can I find out the version Cake I'm running?
If installed via composer it is usually in vendor/cakephp/cakephp/version.txt. Check the content of that file.

Trouble installing Omnipay via Netbeans composer extension

I am currently trying to install Omnipay into my Codeigniter project. I am stuck on windows because I do not have ssh access to the box where this needs to run on. So far I have gotten a new directory in the project root that is named "vendor" and it contains a lot of empty directories referring to Symfony (for what reason is beyond me).
Then I get a runtime exception that I need to enable the openssl extension in my php to download the necessary files and this is where I am stuck at. I don't run WAMP on my computer and I just use the php.exe I downloaded to work with netbeans.
Isn't there an easier way to get omnipay to run? Like just download the files from somewhere and plug them into my project like normal? It seems to be an aweful lot of headache to get a simple library to run in my CI project.
Please forgive my ignorance towards composer but I currently see no benefit of using it for this particular project.
You can "just download" the files here: https://github.com/omnipay/common/archive/master.zip
The problem is, Omnipay depends on Guzzle (an HTTP library), and Guzzle depends on some Symfony components. So you will spend the rest of the day downloading dependencies and making sure you have all the necessary files. That is the problem Composer solves for you.
I don't have any experience running Composer on Windows, but I would start here:
http://getcomposer.org/doc/00-intro.md#installation-windows
Using the Installer
This is the easiest way to get Composer set up on your machine.
Download and run Composer-Setup.exe, it will install the latest
Composer version and set up your PATH so that you can just call
composer from any directory in your command line.
Once you have Composer installed, you should simply be able to make a file named composer.json in your project root, with the following contents:
{
"require": {
"omnipay/omnipay": "~2.0"
}
}
Then use the Command Prompt and cd to your project's directory, and run composer update to download the Omnipay files and all their dependencies.

Symfony2.0.15 Doctrine-Fixtures Windows Command Line Fatal Error

Recently started playing around with S2, amazing stuff! A while ago started an online Symfony2 Blog tutorial, however I got stuck on the page with Doctrine Data Fixtures generation,
Here is the message I'm getting when executing php app/console doctrine:fixtures:load in the console:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in C:\xampp\htdocs\blog-sf2\vendor\bundles\Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand.php on line 40
I am really stuck on it and I am running Windows 7, so can't really use deps file to pull dependencies from older versions (OR CAN I somehow??),
I've downloaded the newest versions of FixtureBundles and DoctrineFixtures.
Really appreciate any help on this one!
I think you need to read the installation documentation of this bundle for the 2.0 branch
You don't really "use the deps" file. The bin/vendors script uses it, and uses git. So what you need to do to "use the deps" is install git (and btw, install git-bash, you'll get a far better terminal).

Categories