blackfire config issue with php probe - php

So I'm trying to install "Blackfire" from Sensiolab and following all the instructions et.. I'm facing an issue when lauching it to profile my app and also for any related php cli that I'm running...:
The error message is:
“Unable to load dynamic library ‘/usr/lib/php/extensions/no-debug-non-zts-20160303/blackfire.so’” => faire enough, there is no blackfire.so in that directory...
The I checked my blackfire.ini and the config seems fien referencing the path where blackfire.so is actually stored:
[blackfire]
extension="/usr/local/Cellar/blackfire-php71-zts/1.23.1/blackfire.so"
I also tried to add some config to php.ini and when I run phpinfo() nothing has been updated...:
[blackfire]
extension=blackfire.so
; On Windows use the following configuration:
; extension=php_blackfire.dll
; Sets the socket where the agent is listening.
; Possible value can be a unix socket or a TCP address.
; Defaults to unix:///var/run/blackfire/agent.sock on Linux,
; unix:///usr/local/var/run/blackfire-agent.sock ;on MacOSX,
; and to tcp://127.0.0.1:8307 on Windows.
;blackfire.agent_socket = unix:///var/run/blackfire/agent.sock
blackfire.agent_timeout = 0.25
Thanks in advance for your help guys

Well actually I resolved the issue by:
Getting rid of MAMP stack as the php version installed with Homebrew was conflicting with the MAMP version and I honesty couldn't figure out which php.ini was used eventually even using the related command... it was showing the homerew one but I had the feeling that this was causing me issues...
I uninstalled balckfire and installed it again (no more MAMP) and of course PHP with Homebrew and it worked fine... just a little set up issue that I had fixed doing the below
changing the default setting in the blackfire.ini
this was defaulted socket=tcp://127.0.0.1:8307 while I have a unix/OSx and the following should have been defaulted instead unix:///usr/local/var/run/blackfire-agent.sock
Hope this will help someone in the same situation

Related

Apache in MAMP Pro 4 has stopped working, refuses to start

Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.
I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...
I've tried numerous suggestions found via Stack Overflow and Google without any success.
Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.
Nothing appears in the logs...
When starting it manually on the command line it comes up with a PHP related error:
$ Applications/MAMP/bin/apache2/bin/apachectl start
httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found
The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.
If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.
apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf
It also looks like hosts entries aren't added to /etc/hosts.
Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...
I and my colleagues are at a complete loss, especially given it was working yesterday...
Has anyone had any issues like this?
I managed to fix the similar issue you had.
My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.
There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.
(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
File > Edit Template > Revert ALL Templates to Default Settings.
Save & restarted the servers and all worked finally and all my hosts had retained as well.
I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.
Hope this helps.

PhpStorm debugger not stopping at BreakPoints; keeps waiting for xdebug _SESSION_

Updated question : PhpStorm | WebMatrix (IISExpress) | Xdebug.remote_port | — Which Port(s) to put where?
I'm running localhost web server on my Windows machine with WebMatrix and IISExpress. I've installed PHP and Xdebug in it and they both are working.
I have a local WordPress install.
I'm now trying to get PhpStorm to debug it using Xdebug.
When I run PhpStorm it launches the web app in the browser with relevant debugging parameters in the browser.
IDE KEY is matching
xdebug.remote_port is configured correctly. (Later I found that this is wrong, but not erroneous. It should be port 9000)
But it seems Xdebug never gets to communicate with PhpStorm. PhpStorm keeps listening, and the execution runs completely without stopping at any break-points.
These lines are crucial to make it work (in php.ini):
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_autostart = 1 # <-------- THIS
xdebug.remote_enable = 1 # <----------- AND THIS
Without these lines xdebug will never work on phpstorm ;)
Try changing the xdebug listen port in your php.ini and your IDE.
Running Mac Yosemite, for me the problem was that I installed with homebrew, following a guide that used php-fpm, which uses port 9000 by default (which conflicts with the xdebug default port)... Changing my xdebug.remote_port to 9001 and changing the xdebug port in phpstorm fixed the problem, though I suspect this issue could happen for anyone in any IDE. I googled for the better part of a day and didn't see this solution (since I believe it's so specific to install method).. but I hope it helps someone.
Took me about an hour until I noticed that this button wasn't activated ;)
"Run" -> "Start Listening for PHP Debug Connections"
First check for on what port xdebug is working on, you can find it in your php.ini under xdebug.remote_port=9123. As you can see in my case it is set to 9123.
Now open PhpStorm go to php debug, see screenshot:
under Xdebug you will find Debug port, make sure that its value is the same as in the php.ini file under xdebug.remote_port (9123 in my case).
Hope it helps
Could be a Firewall.
Day 572... Still haven't slept or eaten... But I finally found the culprit: Windows Defender!
Basically, I had a firewall blocking JetBrains IDE Support chrome extension from sending data to PhpStorm through the default 127.0.0.1:63342 address.
--- Edit
Day 864... Same issue happened again, this time on Linux... But I finally found the culprit: Ubuntu Firewall!
Seriously, this happened to me again a few months later, using Linux, and it was the firewall again. Disabling the firewall solved it sudo ufw disable - If you care for the firewall and want to keep it enabled, gotta dive in deep on creating some sort of whitelist for it.
For me it was changing the line:
xdebug.remote_host=localhost
to
xdebug.remote_host=myComputerIP
( Mac user: in terminal run ifconfig to find your ip )
If anyone else runs into this issue and is using Vagrant, this is what finally fixed it for me:
xdebug.remote_host=10.0.2.2
That needs to be the IP address of your local machine from inside the Vagrant box, and 10.0.2.2 is the default. If you ssh into your Vagrant box, it will show the IP where you logged in from if you want to confirm.
I know this isn't directly relevant to the specific setup the OP had, but this post shows up in a lot of xdebug / PhpStorm Google searches so hopefully this can help someone else.
PHPStorm has a build-in tool in Run > Web Server Debug Validation.
It helped me to solve my problem.
There was a syntax error in php.ini. There were extra "quotes" and ;colons;.
I also obtain this error message.
Also was troubles with the php.ini but more subtle.
Try to find and delete a row like this
extension=php_xdebug-...
Consider to look at my answer here for details "Xdebug - command is not available".
I was having this same problem while trying to test a Laravel project using XAMPP on Windows in PHPStorm. I have no idea what exactly I was doing wrong, but I did get it working eventually. I followed the step-by-step instructions on the PHPStorm site here.
One thing I think that was not configured right was that there was no interpreter set up in the PHP menu in Settings.
I was also trying a few too many combinations of settings in my php.ini. These were the settings that I have when things were working:
zend_extension = C:\xampp\php\ext\php_xdebug-2.3.2-5.6-vc11.dll //as recommended from the Xdebug site itself
xdebug.remote_enable=1=
xdebug.profiler_enable=1
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
In my Run/Debug Configurations, I use a PHP Web Application setting, that just starts on the root of the site. (At first, I thought the appended ?XDEBUG_SESSION_START=<xxxxxxx> was a mistake, but it is not). Hopefully that might help if someone else is facing a similar issue.
Right click "Console" tab and uncheck "Focus on startup" (as seen in below image) should do the trick
I had an issue where one project would work and not another one. I tried many different configurations and I tried looking at the logs of xdebug, etc. This fix seems to have resolved my issue:
Try setting your actual ports of xdebug to 9123 instead 9000.
The new version (9) of PHPStorm changed its default xdebug connetion port to 9123 (the PHPSTORM config, not the actual xdebug config), probably for a good reason, since having the PHPSTORM config to the xdebug default 9000 didn't work but having them set to 9123 did work and resolved the issue.
I tried any of the suggested tricks and finally I called the script by 127.0.0.1/script.php instead of localhost/script.php and bingo!
Based on peteclark3 answer:
I think one of solutions if you have multiple php-fpm versions with xdebug, like php5.6-fpm, php7.1-fpm - make sure only one is running. I had both 5.6 and 7.1 running. Then tried to change on 7.1 to 9001 port. But if I change to 9001 port in PhpStorm, then 5.6 starts not working, because it listens on 9000. So each time you change php version, then probably you would need to change setting in phpStorm. So I think it is better to have only one of php-fpm running and all php-fpm versions can use same port.
This fix is specifically xdebug working but breakpoints not working with docker
Step 1 (check if xdebug actually works):
Go to settings in phpstorm and then debug, check the box 'break at first line...'
Try again, if it breaks at first script xdebug is working
Could be the breakpoints aren't working because it can't find the file.
Step 2 (check your paths mappings are set up correctly):
Go to servers (it's below debug)
Make sure you have a server set up and 'use path mappings' selected
Below that ensure that your php files are mapped to the correct path in the docker container. In my case files were mapped to /var/www/files but actually in the container it was /var/www/app/files.

php & mysql: configuration with a twist

I have a bit of an interesting problem concerning the configuration of php and mysql. I cannot configure them to work together. Whenever try to connect to a mysql database, I get the following error: Fatal error: Call to undefined function mysql connect( ) .
I am currently using the latest version of mysql and php and am using a Windows 7 box as the server.
Due to certain restrictions, I cannot use a prefigured web server or package (no xampp, apache or easyphp). Therefore, I am pretty much restricted to using the built-in development server that comes with php. So far, I have done the editing to the php.ini file, removed the semicolon from php_mysql.dll to remove the ; and changed extension_dir = "C:\PHP\ext" to reflect my extension folder.
I guess the two questions I have are:
A) can the php 5.4 included development server even connect to a mysql database
B) if so, can anyone provide me with some possible fixes to this configuration problem?
Any help given is appreciated.
-
Try running phpinfo(); and see if you have configured it to work with MySQL.
You should enable php_mysql module from php.ini. Default is disabled.
From php.ini:
...
;extension=php_ldap.dll
extension=php_mysql.dll
extension=php_mysqli.dll
...
Remove ; from the corresponding module, save and restart apache.

oci_connect Blank Page in PHP

UPDATE (5/21/2010) SUCCESS!
So after MUCH $head->desk()'ing, I've solved it.
Remember kids, be wary of the instant client version you use, dependent on the virtualization settings!
I had been installing the generic Instant Client (not aware our ESX servers sit on AMD processors, not Intel) and that worked fine internally (the CentOS install was 32-bit since our internal ESXi servers aren't 64-bit). Well lo-and-behold, even if you have a 32-bit install running on a virtualized server which is sitting on an AMD64, it still matters what instant client you install.
It was the last thing I thought to check but as it appears, everything is running fine now.
I would like to thank everyone who helped me run through every possible test to figure this out but in the end, it was my fault for not realizing the differences in the virtualizations.
UPDATE (5/21/2010)
I thought this bug had escaped me when I installed it on a new VM internally but I have now found a narrowing link.
I was trying to install this on our production server when I posted this. After a week of no progress and in need to get back to development, I outfitted a VM on our internal server with a brand new install of Crap... CentOS, and fresh installs of instant client and oci8.
Worked perfectly.
However we just uploaded an exact copy of the VM to our production servers and it magically no longer works. Tried reinstalling everything, no avail.
So the only things I could narrow it down to is a firewall issue (although I get the same issue when trying 127.0.0.1) or possibly an ESX (our production servers) server issue, internal servers are running ESXi.
Any thoughts?
UPDATE (3/8/2010) I installed Xdebug and have it tracing my code. This is the output I am getting:
TRACE START [2010-03-08 17:53:05]
0.2090 327864 -> {main}() /data/aims3/http/octest.php:0
0.2091 327988 -> ini_set(string(14), string(1)) /data/aims3/http/octest.php:3
0.2093 327920 -> error_reporting(long) /data/aims3/http/octest.php:4
0.2094 328048 -> oci_connect(string(8), string(8), string(25)) /data/aims3/http/octest.php:6
The trace halts at that point.
I have installed everything the same way on a local server and it works fine. To say I am at a complete loss would be putting it lightly.
*NOTE: I ran make test and it returned FAIL on every test. I never ran this on my working machine to see if it reports the same errors. Any idea why make test would report FAIL but make doesn't report any error?
I've installed the Oracle Instantclient with no reported errors along with the OCI8 PECL package and at a loss. Whenever I try to open a connection with oci_connect, it halts my entire PHP script.
EXAMPLE:
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
echo "before";
$conn = oci_connect("username", "password", "host");
echo "after";
?>
Returns a complete blank page. The module is loaded (seen in phpinfo) and everything installed with no errors.
I am at a complete loss.
CentOS: 5.4
Apache: 2.2.3
PHP: 5.3.1
InstantClient: 11.2
oci8: 1.4.1
Any thoughts?
NOTES
Apache Error Log reports nothing
Attempted Debugging:
1:
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
echo "before";
if(!function_exists('oci_connect')) die('Oracle Not Installed');
echo "after";
?>
Returns:
beforeafter
2:
Changing host to //host
Returns:
Same error
Is there anything in Apache's error_log? Is this mod_php or FastCGI or normal CGI PHP? What happens if you run the script via the command line?
You could also try setting PHP's error log and looking in there.
EDIT1: Try:
echo "before";
if(!function_exists('oci_connect')) die('Oracle Not Installed');
And post the results...
EDIT2: I'm really not sure. My best bet is this info from the PHP manual:
The most common problem with
installing OCI8 is not having the
Oracle environment correctly set. This
typically appears as a problem using
oci_connect() or oci_pconnect(). The
error may be a PHP error such as Call
to undefined function oci_connect(),
an Oracle error such as ORA-12705, or
even an Apache crash. Check the Apache
log files for startup errors and see
the sections above to resolve this
problem.
Anyone else have any ideas to help out Bryan?
Bryan,
I am going to be honest: I tried this two years ago and failed miserably. :) I could not get the OCI functions to work for anything by compiling myself.
But in the interest of getting it done I looked for an alternate solution and found it in Zend Core for Oracle. All I did was download, run the installer, and it was done. It installs Apache/PHP, MySQL (optional), and the InstantClient for you.
Now as Zend Server, it is basically the same product. I realize that this may not be the solution you hoped for, but if it works...
Zend Server
are you connecting to remote or to local db? i think, for localhost you must replace "host" with "false". I hope, this will help you...
edit: i think, you are missing a parameter...my last suggestions are: 1. you must set the port (default 1521) AND/OR 2. You must enter db name AND/OR you must set the instance name (the ORACLE_SID parameter)
You never check the return value of oci_connect() or call oci_error() but it doesn't look relevant to your problem since you seem to be suffering from a PHP crash. There's an open bug for RHEL that may affect you too:
http://pecl.php.net/bugs/bug.php?id=16626
Did you build the oci8 package yourself? Are you using a third-party binary?
It has been fixed. See the top for details but here is the cliff notes: virtualiztion environments matter.

wamp cannot load mysqli extension

WAMP installed fine, no problems, BUT...
When going to phpMyAdmin, I get the error from phpMyAdmin as follows:
Cannot load mysqli extension. Please check your PHP configuration
Also, phpMyAdmin documentation explains this error message as follows:
To connect to a MySQL server, PHP needs a set of MySQL functions
called "MySQL extension". This extension may be part of the PHP
distribution (compiled-in), otherwise it needs to be loaded
dynamically. Its name is probably mysql.so or php_mysql.dll.
phpMyAdmin tried to load the extension but failed. Usually, the
problem is solved by installing a software package called "PHP-MySQL"
or something similar.
Finally, the apache_error.log file has the following PHP warnings (see the mySQL warning):
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
PHP Warning: Zend Platform does not support this version of PHP - please upgrade to the latest version of Zend Platform in Unknown on line 0
PHP Warning: Zend Debug Server does not support this version of PHP - please upgrade to the latest version of Zend Debug Server in Unknown on line 0
PHP Warning: gd wrapper does not support this version of PHP - please upgrade to the latest version of gd wrapper in Unknown on line 0
PHP Warning: java wrapper does not support this version of PHP - please upgrade to the latest version of java wrapper in Unknown on line 0
PHP Warning: mysql wrapper does not support this version of PHP - please upgrade to the latest version of mysql wrapper in Unknown on line 0
So, for some reason PHP is not recognizing the mysql extension.
Anyone know why? Any solution or workaround?
I deleted the PHP in program files ad everything started working , the problem that there two installations of pHp
I tried many solutions, and none worked for me. I tried the following solutions:
Restart wampserver
Reinstall wampserver
restart machine
and all other solutions mentioned in this question.
However, none of these worked. Then I found that my PHPMyAdmin was not working in chrome and was working in firefox. So I tried clearing cache, restarting browser etc, but still it would not work.
Then I deleted all the files from C:\wamp\tmp and then tried again, and it works. I am not sure why it works, but here is what I think. The session was cached and not getting cleared. So as soon as I deleted all files in this directory all the sessions were deleted and hence it worked fine.
First, make sure that the php.ini file is loading the mysqli extension.
If you are using WAMPServer, click on the icon in the system tray, go to PHP -> PHP Extensions and make sure it is checked. If not, go into the php.ini file and make sure that the line: extension=php_mysqli.dll is uncommented (eg, remove the ; if it exists). If that line does not exist, add it.
If this still does not work, double check that the right php.ini file is being loaded.
To do so, view your phpinfo() (Here for WAMPServer). Scroll down to the Loaded Configuration File row and see which php.ini is being loaded.Make sure it is the right file. If you're using WAMPServer, it should be(WAMP INSTALL FOLDER)\bin\apache\Apache2.2.11\bin\php.ini. By default, it isC:\wamp\bin\apache\Apache2.2.11\bin\php.ini`.
If a different php.ini file is being loaded, just rename it to something else so that PHP will try and find the file somewhere else. There should be a way to specify which on eyou want to use, but I forget exactly how to do that...
If this still doesn't work... Try messing around with phpMyAdmin's settings, or using another answer, but I'm afraid I can't help beyond this.
I was running WAMP with two PHP versions 1) 5.2.9 and 2) 5.2.13.
As per site requirement i needed to change PHP version to 5.2.9 from 5.2.13. after swapping PHP version, error was "mysqli extension is missing". after debugging long time i get to know it was due to wrong "extension_dir" path in php.ini file.
So i changed its value:
Old: "extension_dir" c:/wamp/bin/php/php5.2.13/ext/
New: "extension_dir" c:/wamp/bin/php/php5.2.9/ext/
Restarted All services in wamp server, then it's fixed.
I had the same problem. I had WAMP server installed. All was working fine. Then one day I restarted my computer and it just stopped working! I tried desperately going through all help posts and doing them but nothing worked.
What they usually suggest you do is, first go to your php.ini file and make sure your 'extension_dir' is properly set. Then to make sure these two lines are not commented (remove the ; infront):
extension=php_mysql.dll
extension=php_mysqli.dll
Then some suggested that I download fresh copies of these two files but none worked. I also tried uninstalling everything (php/mysql/apache) and reinstalled fresh copies of WAMP server several times but with no luck.
Finally I managed to find an alternative solution. I switched to 'easyphp' (http://www.easyphp.org/). This is something very similar to WAMP. First I made backups of my sql databases so I can reload them on the new installation.
Then I installed 'easyphp' and everything seems to work fine. I reloaded my sql databases from my backup and now things are back to normal.
I hope someone suffering from a similar prob. will find this useful. If someone has really found a fix to make WAMP server work. Pls do be kind enough to post it here so many will benefit.
in wampserver go to php.ini. open the file and uncomment extension=msql.dll by removing semicolon(;) for respective operating sytem.
Just add in your php.ini:
[PHP_MCRYPT]
extension=php_mcrypt.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
Also setup the mysql password:
SET PASSWORD FOR root#localhost=PASSWORD('your_password');
And the phpmyadmin mysql password in config.inc.php:
$cfg['Servers'][$i]['password'] = 'your_password';
Had the same problem, with wamp. Try to exchange your current version of php.ini with a backup. There is one in: wamp\bin\php\php5.3.0phpForApache.txt. Worked for me.
Just wanted to chime in on this one. Using Wamp Server 2.0, and using Zend Studio with Zend debugger for development.
I wasn't able as of yet (will get back to it at some point) to get the zend debugger working with php 5.3. So in wamp I loaded an earlier php version, 5.2.11. I was getting the same error when acessing php my admin.
What I had to do was change the php.ini file value for "extension_dir" to c:/wamp/bin/php/php5.2.11/ext/ to match the version of php I was using. After that it was all good.
I had this problem and spent 2 hours trying all the solutions online, none worked.
Tried this, and it woked:
Change
mysql.default_host =
to
mysql.default_host = localhost
and restart WAMP. pay attention if you are using mysqli or not.
I had the same error. When I increased the script memory size and enabled E_ALL then restarted the server, I got that error in phpmyadmin. All I had to do to fix it was restart my computer!
I got this problem for a long time. Tried all I've read on forums and this finally worked for me:
Open your php.ini (I assume you've got the good one that is loaded...) and find this line
mysqli.default_port = 3306
change for
mysqli.default_port = 80
Restart all services
Go to localhost/phpmyadmin -> won't work
Reopen the php.ini file and retype this
mysqli.default_port = 3306
Restart all services
Worked for me.
For me worked this, after searching all logs/internet/every non-normal things.
You have to register dl by:
Through application:
WAMP -> PHP settings -> enable dl
or
# php.ini #
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = On
I have just installed WampServer, and faced same problem. I have found solution, that works for me, it is ridiculously simple.
Disable PHP extension php_mysqli.
Restart WampServer, visit local phpmyadmin.
Enable php_mysqli back.
Repeat step 2.
After few page refreshes, remaining errors plates (about MySQL and sqli) had gone.
i tried hard by
installing the wamp again and again,
by checking the php.ini file,
by restarting the machine,
by replacing the index.php file,
but none works.
then i go to the wamp/temp and deleted all files and it works fine now.
I had path variable in windows set to some random version of php.
The fix was to update it and set it to the folder within my wampserver installation:
C:\wamp64\bin\php\php5.6.38
Then I realized this is wrong also for my specific case, and I should actually be running the script from within vagrant. Live and learn.
I had this issue because of a different reason:
Check the PHP Error Log(Get from the Wamp Tray -> PHP -> PHP Error Log.
I had a syntax error in the php.ini file while I was editing the file.
Check the log and clear the error. This will open your PhpMyAdmin properly.
Check your phpForApache.ini file's extensions. This file should be same as your php.ini file.

Categories