Installing Blackfire prob issue - laravel-5

Having some issue trying to get Blackfire.io set up on my homestead box.
Followed the installation guide a couple of times now, and no having no errors.
When I try to use the chrome companion I get the follow error ...
Are you authorized to profile this page? Probe not found, invalid signature
Also when I try to check out what version of the prob I am using via php --ri blackfire I get the follow message despite installing it as per the guide
Extension 'blackfire' not present.
Any ideas!?
Many thanks!

in my case (i'm using vagrant) this helped:
in file
/etc/php5/mods-available/blackfire.ini
add
extension=blackfire.so

In my case, I had to check the black-fire agent status, and when I found out it was not active I restart it and it works fine.
To check the status:
sudo /etc/init.d/blackfire-agent status
To restart :
sudo /etc/init.d/blackfire-agent restart

I had the same problem when installing blackfire probe as mentionned in the official documentation. And here is how i solved it.
Since I am using MAMP's php in my terminal i installed the PHP Probe manually instead of installing it with homebrew.
In fact in the first place i tried to instal it with homebrew and that's how i get the same error as you :
When i run this command :
php --ri blackfire
I get :
Extension 'blackfire' not present.
To fix this issue i had to install the probe manually by following theses steps:
download the probe library as mentionoed in the blackfire doc
You should have a file like this : blackfire-php-**********.so
rename it to: blackfire.so
execute this command in your terminal, it should tell you where you can put the downloaded file:
php -i | grep 'extension_dir'
move the blackfire.so file to the mentionned directory.
Close all your terminal windows and restart mamp
Execute php -m in your terminal; if you can see blackfire in the list that means that your extension is working correctly.

Related

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

Installing sensu, sensu-dashboard does not install

I am installing a sensu server inside a docker container running ubuntu 14.04 but when I install it for some reason it does not install the sensu-dashboard.
When I run the following command to set up the defaults I get a file does not exist error
> Command: update-rc.d sensu-dashboard defaults
Error: update-rc.d: /etc/init.d/sensu-dashboard: file does not exist
I have searched for the file but does not seem to be installed anywhere.
Has anyone else had this problem before when installing sensu or know how to fix it?
Thank you
The default Dashboard was removed on July 28th so you missed it by a day!! :( You now have to use a different dashboard. Uchiwa is a great choice and is under very heavy development, so I am sure it will continue to become more feature rich.
link to uchiwa's github page
The default Dashboard was removed that is true but if want to use sensu-dashboard then go for Sensu-Enterprise.
Here is the link: http://sensuapp.org/enterprise

MariaDB homebrew install errors

I have just installed MariaDB via homebrew on my Mac. At the end of the installation I got the following error:
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mariadb`
If I run brew postinstall mariadb I get:
==> /usr/local/Cellar/mariadb/5.5.34/bin/mysql_install_db --verbose --user=andrew --basedir=/usr/loca
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria
Please check all of the above before mailing us! And remember, if
you do mail us, you should use the /usr/local/Cellar/mariadb/5.5.34/scripts/mysqlbug script!
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Which isn't helpful! The tutorial I was following told me to run unset TEMPDIR, then mysql_install_db --user=mysql --basedir=$(brew --prefix mariadb); running those results in the following:
/usr/local/opt/mariadb/bin/my_print_defaults: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2)
Fatal error in defaults handling. Program aborted
chown: ./data: Operation not permitted
Cannot change ownership of the database directories to the 'mysql'
user. Check that you have the necessary permissions and try again.
I suspect the problem has something to do with the /usr/local/etc/my.cnf.d folder. I've seen this referred to in a couple of things I've tried, but it doesn't exist on my machine. I have tried a few different mysql_install_db commands I've found in other tutorials, but they all throw up a (different) error message.
Thanks for any help!
Just open the config file at /usr/local/etc/my.cnf with your editor and comment out the following line:
!includedir /usr/local/etc/my.cnf.d
Having been unsuccessful with further Googling of the problem I tried manually creating a /usr/local/etc/my.cnf.d and now the mysql_install_db command seems to have worked okay. I'm not sure if this is the appropriate solution or if my.cnf.d not existing is indicative of a deeper problem with the install but, as things seem to be working, I'll mark as resolved.
[Update] As I was a little unsure in my answer whether this was the 'correct' solution I just wanted to confirm that, after a month, everything is still working fine.
None of the solution here helped, I had to do this:
The post-install step did not complete successfully MySQL Mac OS Sierra
in short,
I made a backup of the folder /usr/local/var/mysql , then removed it
removed Mariadb brew remove mariadb
reinstalled Mariadb brew install mariadb
run brew services start mariadb
After that I could access with mysql -u root
You might have an orphaned configuration file. I was able to solve this problem by deleting an old /usr/local/etc/my.cnf. YMMV.
If you're having this problem in 2021
This worked for me:
sudo mysql_install_db
sudo chown -R <YOUR USER NAME HERE> /usr/local/mysql # for example sudo chown -R jperez /usr/mysql
sudo chgrp -R admin /usr/local/mysql
After that, running mysql or mariadb will show the database prompt.
This problem seems to have recently gone away.
A simple bew upgrade resolved the problem for me.
You may want to go
/usr/local/mysql
and delete the old MySQL file and install again

Class 'AMQPConnection' not found

I am using Mac OSX Lion. I am running php ver 5.3.6 through MAMP and when trying the create a AMQPConnection I get this error
Class 'AMQPConnection' not found
I installed rabbitmq through macports using this command
$ sudo port install rabbitmq-server
I run the server using this command
$ sudo rabbitmq-server -detached
It all works fine
I added "extension=amqp.so" to my php.ini file. More specifically my /Applications/MAMP/bin/php/php5.3.6/conf/php.ini file.
I have rabbitmq-c
I ran autoreconf -i && ./Configure && make && sudo make install with no errors
I configured rabbit with this command phpize && ./configure && make && make install
All that seemed to go perfectly.
I even created my user with permissions and verified those permissions with the web plugins that can be accessed through localhost:55672
I even tried copying amqp.so into my /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/ file in a futile attempt to get it working.
Everything that I have done has seemed to work flawlessly. I get no error/warning messages. The Rabbit server is running. I ran it without the -detached option to see if I was getting any errors there. Nothing.
Any Suggestions??????
Best way to test your RabbitMQ Server installation is by testing with simple python code.
Installing PIKA library on Mac OSX is very easy. Follow the steps given here.
http://www.rabbitmq.com/tutorials/tutorial-one-python.html
copy paste and create two python files receive.py and send.py. Execute these from two terminal windows. In about 10 minutes you'll know that RabbitMQ is able to receive the message and queue.
Create the info.php on server with
Check the results from browser if it shows AMQP library is active.
I feel your RabbitMQ server is installed, but PHP library is not getting loaded correctly.
Check your error.log. There must be some details why it is failing to load 'amqp.so' file.
Can You please Add:
use PhpAmqpLib\Message\AMQPMessage;
under your:
use PhpAmqpLib\Connection\AMQPStreamConnection;
line and it will work.

Problems discovering channel in PEAR

im having this problem. everytime i try to install something using channels i get this error:
Discovering channel pear.phing.info over http:// failed with message: channel-add: adding Channel "pear.phing.info" to registry failed
Trying to discover channel pear.phing.info over https:// instead
Discovery of channel "pear.phing.info" failed (channel-add: Cannot open "https://pear.phing.info/channel.xml" (Connection to `pear.phing.info:443' failed: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?))
im not beyind any proxy, openssl is on
using windows and wamp server
any ideas???
thanks
It seems like its using PHP to make the connection. You need to make sure that openssl is enabled in your php.ini file.
Uncomment the line: extension=php_openssl.dll in php.ini
OR
For mac users you will need to use macports:
sudo port install php5-openssl
I had the same problem. No Proxy, OpenSSL enabled. I ended up with installing it "the new way": Just download the PHAR package, which also contains all dependencies. Run it via php phpunit.phar.
I've got the same error when trying to install phpunit
In my php.ini file
i've uncommented the line bellow by removing ";"
;extension=php_openssl.dll
Saved changes. And then i've run in cmd :
pear channel-discover pear.phpunit.de
pear upgrade-all
pear update-channels
Same problem.
So i've downloaded the phpunit.phar from this link and then i've run in cmd
php phpunit.phar
Now it's working :)
Set the proxy and everything should work:
pear config-set http_proxy http://login:pwd#server:port

Resources