I am trying to install the Restful client of CodeIgniter: https://github.com/philsturgeon/codeigniter-restclient.
For the moment I just copy the Rest.php file in the libraries directory. But when I load the library via:
$this->load->library('rest', array(
'server' => 'http://localhost/restserver/index.php/api/api',
'http_user' => 'admin',
'http_pass' => '1234',
'http_auth' => 'basic' // or 'digest'
));
It rediects me to the GitHub website. How can I install it correctly?
Related
Laravel Version: 9.11
Adldap2-Laravel Version: 6.1.6
PHP Version: 6.1.6
LDAP Type: ActiveDirectory
Description:
I'm trying to Authenticate to my Active Directory with Laravel project. But i faced to this error message The 'username' key is missing from the given credentials array when i try to log in.
Steps i've followed:
composer require adldap2/adldap2-laravel
Adldap\Laravel\AdldapServiceProvider::class,
Adldap\Laravel\AdldapAuthServiceProvider::class,
'Adldap' => Adldap\Laravel\Facades\Adldap::class,
php artisan vendor:publish
in the file ldap.php i made this changes
'hosts' => explode(' ', env('LDAP_HOSTS', '...')),
'base_dn' => env('LDAP_BASE_DN', 'DC=host,DC=com'),
'username' => env('LDAP_USERNAME', 'Admin_username'),
'password' => env('LDAP_PASSWORD', 'Admin_password''),
auth.php
'providers' => [
'users' => [
'driver' => 'ldap', // Was 'eloquent'.
'model' => App\User::class,
],
also ENV.
LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_HOST='...'
LDAP_USERNAME=''
LDAP_PASSWORD=''
LDAP_PORT=389
LDAP_BASE_DN="DC=*,DC="
LDAP_TIMEOUT=5
LDAP_SSL=false
LDAP_TLS=false
then i use the command php artisan adldap:import it shows me that
Found 418 user and when i want to import them successfully imported
/ synchronized 0 user(s) also i tested if the connexion is working
with php native and that's worked.
Can someone help me ?
Thanks
I just installed humhub and downloaded the chat module from github. https://github.com/ychoucha/HUMHUB-module-chat
I gitcloned it to humhub/protected/modules. But, it does not show up in the modules section of administration login. How do I install this or other third part modules in Humhub?
According to this link https://github.com/humhub/humhub/issues/165 on Sep 12, 2014, Luke said:
You can also install modules manually:
Download Module (e.g. mail)
Put it into protected/modules/mail
Enable it in Administration -> Modules
I've tried with the Tasks modules and it worked. Make sure you have the latest stable version of the code from the Humhub repository. You also must be able to download that directly from the Administration > Modules > Find Online
The module no longer works since humhub v1.0.
According to the docs you need to add a config.php file.
https://www.humhub.org/docs/guide-dev-module.html
config.php (replaces autostart.php)
<?php
use humhub\modules\dashboard\widgets\Sidebar;
return [
'id' => 'chat',
'class' => 'humhub\modules\chat\ChatModule',
'namespace' => 'humhub\modules\chat',
'events' => [
array(
'class' => Sidebar::className(),
'event' => Sidebar::EVENT_INIT,
'callback' => array(
'humhub\modules\chat\ChatModule',
'onSidebarInit'
)
),
],
];
I am trying to get memcache to work with Zendframework 2. How do I get Zendframework 2 to see memcache correct so I don't get the error I have listed below? I want to use memcache instead of memcached.
Error:
Exception - An abstract factory could not create an instance of memcache(alias: memcache).
Previous exceptions - An exception was raised while creating "memcache"; no instance returned
The option "liboptions" does not have a matching setLiboptions setter method which must be defined
I get this error when just trying to test it with this line in a controller
echo $this->getServiceLocator()->get('memcache')->getVersion();
Details:
I'm running windows 7 64 bit with a local instance of IIS7 up and running.
I used this guide to install memecache on my pc: How to Install Memcache on Windows 7
I verified the memcache service is up and running
I verified that using memecache outside of Zendframework 2 works.
So next I followed this guide to get it to work in Zendframework 2: How to setup Zendframework 2 to use Memcached I know this guide is for memcached and not memcache but I used it as a base
Troubleshooting I've done already:
Verified service is running
Verified phpinfo() shows the memcache section so I know the php extension is loading from the php.ini
Since I'm still hazy on memcache vs memcached I've tried setting the config files and above echo to try and use the string
'memcached' and 'memcache' to see if that would help find it, but
didn't work.
I read some things online about how a 'Di' thing can conflict with this. I verified my config does not load anything with 'Di'
Verified that the abstract factory setting is loaded in the config under Service Manager
Code:
config var_dump showing the abstract factory part is loading
$sm = $this->getServiceLocator();
$config = $sm->get('config');
var_dump($config);die();
'service_manager' =>
array (size=3)
'abstract_factories' =>
array (size=2)
0 => string 'Zend\Cache\Service\StorageCacheAbstractServiceFactory' (length=53)
1 => string 'Zend\Log\LoggerAbstractServiceFactory' (length=37)
'aliases' =>
array (size=2)
'translator' => string 'MvcTranslator' (length=13)
'db' => string 'Zend\Db\Adapter\Adapter' (length=23)
'factories' =>
array (size=1)
'Zend\Db\Adapter\Adapter' => string 'Zend\Db\Adapter\AdapterServiceFactory' (length=37)
My cache.local.php and it's in the autoload directory of zendframework 2 (taken from above tutorial link and removed the 'd')
I think this is what I need to change just not sure how....
return array(
'caches' => array(
'memcache' => array( //can be called directly via SM in the name of 'memcache'
'adapter' => array(
'name' =>'memcache',
'lifetime' => 86400, //24 hours
'options' => array(
'servers' => array(
array(
'127.0.0.1',11211 //Server IP, Port
)
),
'namespace' => 'MYMEMCACHENAMESPACE',
'liboptions' => array (
'COMPRESSION' => true,
'binary_protocol' => true,
'no_block' => true,
'connect_timeout' => 120
)
)
),
'plugins' => array(
'exception_handler' => array(
'throw_exceptions' => false
),
),
),
),
);
You need to install the PHP library memcached so you can use ZFs Memcached Adaptor. ZF does not have an adaptor for the memcache library so it's trying to use the library directly which does not have a setter for liboptions. Either install memcached or remove liboptions in your config and you should be all set.
I'm facing an issue to send email. I have my website built with Laravel. I have the files set up properly. That happens in 2 files.
The first one contains "driver" which of course is mailgun, "host" (smtp.mailgun.org), "port" (587 and according to my provider it's opened), "encryption" (tls), "username" and "password" (both with the right values).
The second one contains "domain" and "secret" (also both with the right values).
The domain is not the mailgun domain but my own domain, which is ACTIVE after set the Domain Verification and DNS.
The mailgun domain is still there ACTIVE. I don't know if I have to remove it or something. I really don't know what I'm missing here.
IMPORTANT UPDATE
Class 'GuzzleHttp\Client' not found
I'm receiving that message
mail.php
return array(
'driver' => 'mailgun',
'host' => 'smtp.mailgun.org',
'port' => 587,
'from' => array('address' => 'not-reply#xxxxxxxxx.com', 'name' => 'xxxxxxx'),
'encryption' => 'tls',
'username' => "xxxxxxxxxxxxxx",
'password' => "xxxxxxxxxxxxxx",
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
Obviously, the xxxxxxxxxx are my personal data. I can assure I'm setting the right values. It should work, indeed. :(
services.php
return array(
'mailgun' => array(
'domain' => 'domain-here',
'secret' => 'key-here',
),
'mandrill' => array(
'secret' => '',
),
'stripe' => array(
'model' => 'User',
'secret' => '',
),
);
domain and secret are populated with the right values too.
The #manix suggestion it seems to be the right approach but the version suggested 3.9 is deprecated. So it should be:
"guzzlehttp/guzzle": "~4.0"
As I have the project built with Laravel 4.2.
It should be 5.0 for Laravel 5.0.
Try to require guzzle dependency directly.
Add "guzzle/guzzle": "~3.9#dev" to composer.json like, example:
"require": {
"laravel/framework": "5.0.*",
"guzzle/guzzle": "~4.0"
},
Update your project. The command below shoul be executed in a terminal/console. For example, if your laravel application is hosted in a windows machine, you do:
> cd project/folder/path // change the working path
> composer update // this command update the proyect and dependencies
If you laravel is hosteed in a linux machine the you do:
$ cd /path/a/mi/folder // change the working path
$ composer update // this command update the proyect and dependencies
Test again your application
How do I get laravel to work on local host from pagodabox? I've installed laravel 4 through pagoda box, then cloned it to localhost. I then ran composer install to get all the dependencies and updates. When I try to navigate the URI to the public directory, it doesn't show me a "you have arrived" screen. Instead I get the following error message:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [tcp://tunnel.pagodabox.com:6379]
I then looked in "database.php" and noticed that the redis array was modified, so I copied the same one from a fresh installation of Laravel, but then I got the following error:
No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]
I Had the same problem, just change the bootstrap > start.php file, search for
'local' => array('your-machine-name')
and change it with your machine name.
This video help me to deal with that: http://www.youtube.com/watch?v=CJoU-LO8Ufo , in the video he changes it to the virtual host but that didn't work for me, i had to put my computer name.
On Mac the computer name can be found by typing hostname in the terminal.
Joshdcid's answer is right for some, but not all. I found this in my bootstrap > start.php file:
'local' => array('homestead')
..., and changing that variable in any way caused my laravel app to not load at all. Not only that, but in a fresh install of laravel, this local variable had the same value of 'homestead'.
After spending a bit of time in WinMerge, I found that you should use Wayne's tip of changing
'redis' => array(
'cluster' => false,
'default' => array(
'host' => 'tunnel.pagodabox.com',
'port' => 6379,
'database' => 0,
),
),
to
'redis' => array(
'cluster' => false,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
at the bottom of the app > config > database.php file, then you should also go to the top of the
app > config > session.php file and change
'driver' => 'redis',
to
'driver' => 'file',
..., just as a fresh install would have. You should be able to view your app now!