enable ldap module in laravel homestead - laravel-5

Currently have an issue where i can not enable the ldap module in homestead. I have changed multiple php.ini files and still nothing seems to be working. Has anyone else had issues with enabling modules in homestead?
Side note: when trying to restart php-fpm i am getting a permission denied issue. They prompt me with a password (which i have tried "secret") but still cant seem to get that to work either.
Have restarted the homestead instance multiple times as well. no prevail.
any thoughts?
Citti

I think this question deserves its own answer as it's pretty easy to install the wrong version of ldap on homestead and not know why things aren't working.
TL;DR: Match the version of ldap to the version of php you're running & install with apt-get.
For example, running homestead v.6.1.0:
cd HOMESTEADFOLDER # on your host
vagrant ssh # access the guest machine
sudo apt-get update # update apt-get package list
sudo apt-get install php7.1-ldap # or whatever version
In my example above, if you switch out php7.1-ldap for php7.0-ldap everything appears to install correctly (it does in fact install correctly) but, in reality, you've installed the module to a version of php that's not actually running. It took me several attempts at rebooting FPM to figure out this is what I had done.
Side note: apt-get will restart php and reload modules so there's no need to try and reboot the server or mess about with .ini files.
While ssh-ed in to the guest machine, you can check that the package is installed with php -m
If ldap is a thing your project needs, it's probably a better idea to handle this in a script. The answer referenced by fh-jashmore in his comment above comment has a simple but solid example: How to automatically enable php extensions in Homestead on vagrant up

Related

Unable to start a virtual machine on Virtualbox - Ubuntu 18.04 - infamous problem - no solution works

While trying to use Laravel's Homestead environment, I had to install vagrant and virtualbox.
I already had an older version of Virtualbox.
uninstalled it and installed a new one, then installed Vagrant.
While trying to start my virtual machine I've got a well known issue:
For the past 2 days I've tried EVERYTHING
I've tried
sudo /sbin/vboxconfig
which didn't work, So as suggested in a few posts, I've disabled secure boot from the BIOS.
It still didn't work.
I've tried every type of uninstalling with apt, apt-get and dpkg for everything that includes "virtualbox" in it's package name. Also purged, autoremove and autoclean everything possible.
I've checked the lists and seems like I'm all clean of virtualbox.
But when I'm installing it again directly from the VB website with an installer (version 6.1) it happens again and again.
Funny thing is that no matter how much I clean or purge, whenever I'm installing it again, all my virtual machines are still there. meaning there's still something I'm missing...
Please help. Thanks a LOT!
I've read just about everything about it including:
https://askubuntu.com/questions/1163267/virtual-box-works-no-longer-suspect-a-kernel-update-caused-this
http://mitreasorin.blogspot.com/2016/08/upgrade-virtualbox-rtr3initex-failed.html
https://forums.virtualbox.org/viewtopic.php?f=7&t=79035
Unable to start Vagrant VirtualBox on Ubuntu
https://askubuntu.com/questions/1163267/virtual-box-works-no-longer-suspect-a-kernel-update-caused-this
https://forums.linuxmint.com/viewtopic.php?t=292858 (for /sbin/vboxconfig that didn't work)
https://forum.manjaro.org/t/virtualbox-not-working-cant-rmmod-vboxdrv/86277
And a lot more. too many to mention, it's just about repeating the same things.

how to uninstall sonarqube-6.4.1 from ubuntu

h all ,
i am trying to uninstall sonarqube from the ubuntu machine using command "sudo apt-get remove --purge autoremove sonarqube-6.4.1" but I am getting error as no packages foun some one kindly help me with uninstalling soanrqube complaetly from ubuntu machine
Your purge isn't working because SonarQube likely wasn't installed via apt-get. So how was it installed? The docs offer clues:
Installing the Web Server tells you to download the SonarQube zip, expand it, and configure the properties file. So your first step would be to wipe out the SonarQube directory.
Of course, if SonarQube is running as a service on your machine, just deleting the diretory could lead to errors at the next startup, so you'll need to unwind that part too. For setting up a service, the docs advise you to:
create /etc/init.d/sonar
create a link in /usr/bin/sonar to the SonarQube start script
update your defaults
So you'll want to back those things out too.

Vagrant stalling on boot

I am trying to get a virtual machine working with Vagrant. Everything seems to run fine and it begins to unpack/install all the needed files. But every single time it just stalls when I get to this point.
==> default: Setting up grub-pc (2.02~beta2-36ubuntu3.11) ...
Here is a screen shot of what is going on:
I shut down the virtual machine and booted it back up. I can ssh into it but nothing seems to work. By this I mean there is no psql, no SQLAlchemy. These, among other things, are supposed to be set up in the VM. It seems as if it halts before installing the necessary software.
I've tried vagrant destroy and reinstalling, downloading a new image in case that one was corrupt and I tried reinstalling Vagrant. I am running Vagrant 1.9.5
Looks like you're provisioning with shell commands. I'm guessing that there's some sort of install prompt that's coming up and demanding some sort of user interaction / response. Because vagrant's handling the provisioning behind the scenes, you can't respond to the prompt and the install is not continuing.
You should be able to fix the issue by editing your Vagrantfile. As a guess, it looks like grub-pc is causing the issue (there's actually a grub-pc command prompt in the image you shared). See if you can figure out which package is installing grub-pc. If you're lucky, the problem can be solved by piping in a yes along with the install command (which will automatically answer yes to all install questions). This looks something like yes | sudo apt-get install grub-pc. If grub-pc is being installed as part of another package, you'll need to do some educated guessing to figure out which package is installing it and adding the yes | apt-get pipe to that install line (or just add the pipe before every install line).
This being said, I ran into an issue when I was installing the Java SDK on vagrant, where Oracle was demanding I accept their terms of use before the install would complete and a yes pipe wouldn't solve the issue. I was able to fix it by searching the web for "silent java sdk install via command line". If you can figure out which package is causing the issue, and a yes pipe isn't enough, searching for how to "silently" install that package via command line should help.
UPDATE
As you can see in a comment on this answer
Unfortunately a yes pip didn't do the trick this time but a quick
search on how to "silently" install grub led me to this.
DEBIAN_FRONTEND=noninteractive apt-get -y -o
Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
upgrade . After editing my Vagrant file it worked perfectly

Composer Error while installing Laravel "Failed to decode response: zlib_decode(): data error"

I've already installed laravel a lot of times, but today when I had to install it for my project I experienced the following strange error:
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode
I ran the following command to install laravel:
composer create-project laravel/laravel myproject --prefer-dist
in my /var/www/ directory which is totally read, write and executable.
Try the following command:
composer clear-cache
Add this lines to " composer.json " before the last line that conten this symbol " } "
,
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{ "packagist": false }
]
Now cd to your project folder and type :
Composer install
Credits to:
http://www.webdeveloper.com/forum/showthread.php?285403-Need-Help-Installing-Laravel
Short: Run composer self-update --update-keys and follow instructions.
Step by step:
I had the same error when trying to install dependencies for my project:
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Your configuration does not allow connection to http://packagist.org. See https://getcomposer.org/doc/06-config.md#secure-http for details.
http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Just to be sure, I tried to update the composer with composer self-update, which gave me the same error, but another hint:
[RuntimeException]
The phar signature did not match the file you downloaded, this means your public keys are outdated or that the phar file is corrupt/has been modified
The issues is solved by running
composer self-update --update-keys
and entering the keys from Composer Public Keys / Signatures page. I was able to download my dependencies afterwards.
In my case, the version of VirtualBox was the issue.
https://github.com/composer/composer/issues/5814
Make sure that your VB is not 5.0.28 or 5.1.8.
Following what #dwainm says, you can also define this configuration globally to avoid editing the composer.json from your project.
Create a ~/.composer/config.json with:
{
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{
"packagist": false
}
]
}
install or update the library after running
composer config --global repositories.packagist.allow_ssl_downgrade false
If you look at the answers people come up with this, there are a wide variety of things that fixed it for various people, including using "sudo", using "self-update", etc etc.
After a lot of testing, I found that the real answer is to just keep on running it over and over again. It gets a little farther each time, and caches the previous data that it was able to get the last time. So eventually it just works, and then people think that the last thing they did is what solved it. In reality you just have to run it over and over. This is clearly something that composer should fix.
The key to seeing that it is making progress each time you run it is to use
composer update -vvv
That will show you how far it got with the last time you ran it. Each time you run it, it will usually download another repo or two.
Until composer fixes whatever the underlying cause is, that appears to be the best solution. Good luck.
Quick fix from composer
Degraded Mode#
Due to some intermittent issues on Travis and other systems, we introduced a degraded network mode which helps Composer finish successfully but disables a few optimizations. This is enabled automatically when an issue is first detected. If you see this issue sporadically you probably don't have to worry (a slow or overloaded network can also cause those time outs), but if it appears repeatedly you might want to look at the options below to identify and resolve it.
If you have been pointed to this page, you want to check a few things:
If you are using ESET antivirus, go in "Advanced Settings" and disable "HTTP-scanner" under "web access protection"
If you are using IPv6, try disabling it. If that solves your issues, get in touch with your ISP or server host, the problem is not at the Packagist level but in the routing rules between you and Packagist (i.e. the internet at large). The best way to get these fixed is raise awareness to the network engineers that have the power to fix it.
To disable IPv6 on Linux, try using this command which appends a rule preferring IPv4 over IPv6 to your config:
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
If none of the above helped, please report the error.
I'll leave this answer to those like me have tried all of the above solutions do not succeed. In my case the problem was related version of Virtual Box (1.5.8) for Mac. I did downgrade my previous version (1.5.2) and all returned to work properly.
This may seem redundant, but try restarting your machine. If you've just installed composer and other things, then your system may just need to be refreshed..
I was having this same issue, but it is now working correctly after a restart (on Mac).
There are many answers to this question because there are a variety of factors that could be causing this issue. It basically comes down to 1) a caching issue, 2) a connection issue to your repository (e.g. Packagist), or 3) a config issue with your Composer project.
Before you reconfigure your entire setup, eliminate options 1 and 2 first. For example, on May 23, 2017 Packagist was having issues, so switching to a different mirror solved the issue for me.
in Linux i used sudo before 'composer update' and problem solved.
sudo composer update
composer clear-cache
sudo composer self-update
Use the command composer clear-cache to clear composer cache. Also, make sure you have access to your .composer directory. It is usually located in ~/.composer.
Check that you have ZIP extension installed for your PHP CLI
for me helped(ubuntu): sudo apt-get install php7.0-zip
here is the correct way of installation of composer for slim.
1.start the composer installer (composerSetup.exe)
note: if no php.exe file is selected by default, then go to the folder of your installation (wamp, xamp, lamp -your choice of installation) folder and under bin folder, look for php\php.exe - which happens to be your command-line php for slim.
2.start the wamp, xamp or lamp (of your choice) server (to avoid the error "failed to decode zlib stream" )
3. then proceed with the rest of the installation(which will eventually lead to completion of installation with no user input required further).
I ran in the same issue while trying to composer install doctrine/dbal
This message kept showing: Failed to decode response: zlib_decode(): data error
I had to update my composer.json by adding the following lines:
{
...
"config": {
"http": true
}
...
}
And it fixed the problem. I hope it will help some of you.
For me, this error disappears when I switch off my VPN (ExpressVPN). The other methods suggested here did not work.
In my case, the issue was caused by bad file permissions in my ~/.composer directory.
So I ran
sudo chown myusername:myusername ~/.composer
(replacing myusername with my actual user name)
Then composer ran fine.
in window i used this cmd
php composer.phar clear-cache
Workaround Mac OS X:
Get name of your network device:
networksetup -listallnetworkservices
Disable IPv6 on that device (in this case "Wi-Fi"):
networksetup -setv6off Wi-Fi
Run composer ...
You can enable IPv6 again with:
networksetup -setv6automatic Wi-Fi
From Composer documentation:
Due to some intermittent issues on Travis and other systems, we
introduced a degraded network mode which helps Composer finish
successfully but disables a few optimizations. This is enabled
automatically when an issue is first detected. If you see this issue
sporadically you probably don't have to worry (a slow or overloaded
network can also cause those time outs), but if it appears repeatedly
you might want to look at the options below to identify and resolve
it.
If you are using IPv6, try disabling it. If that solves your issues,
get in touch with your ISP or server host, the problem is not at the
Packagist level but in the routing rules between you and Packagist
(i.e. the internet at large). The best way to get these fixed is raise
awareness to the network engineers that have the power to fix it. Take
a look at the next section for IPv6 workarounds.
SOLUTION FOR LINUX:
To disable ipv6, you have to open /etc/sysctl.conf using any text editor and insert the following lines at the end:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
I have been facing a similar problem. Writing the given lines in your composer.json files and then run composer update following the next composer command. Hope it helps someone as it does to me.
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{ "packagist": false }
]
For Windows 10
According to TroubleShooting Composer as stated by other answers also for other OS, this may happen due to ipv6. If we disable it for all tunnels, it gets solved in Windows 10.
To disable ipv6 in Windows:
Download EasyFix file from Microsoft Support and follow the steps as stated there:
Click the Download button for the procedure that you want to run.
Click Run or Open in the File Download dialog box.
Follow the steps in the easy fix wizard.
Note: I downloaded Disable IPv6 on all tunnel interfacesversion and ran it. Then I could use composer create-project command.
Try composer clear-cache and then turn off your windows firewall
For linux ubuntu 20.04
try these step by step:
0-go to home by command "**cd ~**"
1-**composer clear-cache**
2-remove old version of composer (1.x.x) if exists "**sudo rm -R ~/.config/composer**"
3-change your internet connection(cable or wifi or ...)(important)
4-install new version with these commands...
4-1: **sudo apt update**
4-2: **sudo apt install php-cli unzip**
4-3: **sudo apt install curl**
4-4: **cd ~**
4-5: **curl -sS https://getcomposer.org/installer -o composer-setup.php**
4-6: **HASH=`curl -sS https://composer.github.io/installer.sig`**
4-7: **php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"**
4-8: **sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer**
4-9: check composer version with "**composer --version**"
if return composer 1.x.x, check this:
php /usr/local/bin/composer
if return 2.x.x, you must find your composer that installed locally and delete its folder.
Do Not Remove this folder /usr/local/bin/composer
For myself, I just made
sudo apt-get upgrade composer

Does reinstalling Macports remove/destroy contents of /opt/local/ directory structure?

I'm running a MacPro G5 w/ 10.5.8. I ran:
sudo port selfupdate and then ran:
sudo port upgrade outdated
When it was all finished, I rebooted and apache2 was broken and would not serve PHP file any longer. If I replace the httpd.conf file, it will serve html files.
I finally gave up and restored the backup and the machine is running again. The problem is I have a second machine that I did the same thing on and don't want to go through the same process. I've read several posts about uninstalling/reinstalling Macports like this one from Kirk Roybal How to do a clean reinstall with macports?, but it doesn't say if this process will destroy or reset the contents of the /opt/local/ directory. Especially the MySQL DBs and htdocs contents. Does anyone know if this process is linked or destructive? I'll make backups of everything, of course, before trying anything.
SOLUTION:
I got it to work by making the php53 install work instead of going backwards. Here's what I did:
sudo port select --set php php53 (set MacPorts to use php53 instead of php5)
sudo port installed (Check to make sure php53-apache2handler is installed)
sudo port install php53-apache2handler (It wasn't and yours probably isn't either)
once that's done installing
php -v (check the version of PHP that's running)
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n php mod_php53.so (activates php within apache)
this should append
LoadModule php5_module modules/mod_php53.so
to your /opt/local/apache2/conf/httpd.conf file (check it now)
There will also be a line like this
LoadModule php5_module modules/mod_php5.so
Comment it out or remove it so is doesn't interfere with new install
It should also move a copy of mod_php53.so to
/opt/local/apache2/modules
If it's not there, see php53-apache2handler install above.
Check your httpd.conf file for errors
/opt/local/apache2/bin/httpd -S
Finally, create/edit php.ini file to tell apache2 how to connect to MySQL database
cd /opt/local/etc/php53
sudo cp php.ini-production php.ini (for production machine use development for dev machine)
sudo cp php.ini php.ini.bak
Add the default socket paths to php.ini
pdo_mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock (may vary based on MySQL version. Check the /opt/local/var/run directory if not sure)
mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock
mysqli.default_socket=/opt/local/var/run/mysql5/mysqld.sock
If you are having problems connecting to MySQL, check for typos in the above paths FIRST. Trust me it will save you tons of time!
If all went according to plan, you should be able to restart the machine, test to make sure all ports started automatically and things should be working.
The files that you add (eg: MySQL DBs) are not destroyed by an update. If you modify files that are managed by MacPorts (eg: they are listed in 'port contents '), then those modifications will be clobbered by an update.
Some projects install config files as examples and have the user make the real config file so as to not clobber it with an update. It looks like the apache2 port follows this pattern. It installs /opt/local/apache2/conf/original/httpd.conf and then copies it to the real location of /opt/local/apache2/conf/httpd.conf at activation time only if the file does not exist.

Resources