xhprof_enable is undefined, even after loading module in php.ini - xhprof

I've installed xhprof but Apache is not loading the extension.
The extension is loaded in the php.ini, but I get the following error:
Fatal error: Call to undefined function xhprof_enable() in /home/bd/public_html/application/hooks/xhprof.php on line 15
Can someone help me?

I think it's because the xhprof is no accurately loaded.If use the commod 'php -m', maybe you will find there is no xhprof.
You can check if you have added the flowing to the 'php.ini'.
[xhprof]
extension=xhprof.so
xhprof.output_dir=/tmp

Had the same problem.
I am using PHP5.6 so i could easily install XhProf using the following:
apt-get install php5.6-xhprof

Maybe you've forgotten to restart php-fpm (or Apache, or other servers related with php, depends on which server you use).
After restart php-fpm (or Apache), you may meet the following (via phpinfo()):
And then, xhprof_enable() works.

You need reload the php-fpm service.

Related

Apache httpd and Easy Apache 4 (Installing mod_wsgi for python app)

It's been a while but I am running into an issue and could not find any answers elsewhere.
I pay for a dedicated server that is running Easy Apache 4 with Centos 7. I have root access to everything so no limitations.
I am in the process of deploying a Python/Django app on the server for a client. When trying to install mod_wsgi it errors out stating it needs the package httpd-mmn. I can install the httpd module using yum but I am worried about conflicts since the server is using Easy Apache 4.
Is this a relevant concern? I have a bunch of php sites on my server and I am afraid I'll break it.
For the record, I do not want to use the experimental easy apache mod wsgi as it's, well...experimental and a use at your own risk situation.
Any thoughts or recommendations would be great.
mod_wsgi is often built for a specific version of apache.
You are getting errors because your apache was installed by easyapache4.
I suggest you go with the experimental version for 2 reasons
You really don't have much of an option, unless you want to build everything yourself from ground up.
the ea-apache24-mod_wsgi has been available for install for at least 6 years now and I have searched thru the web and none has complained of errors or breaking things
If you (or anyone else) choose to go the experimental route, the process is
yum install ea4-experimental
yum install ea-apache24-mod_wsgi
Then modify the virtual host configs by creating directives and including these files
/etc/apache2/conf.d/userdata/std/2_4/{user}/{domain}/{includename}.conf
/etc/apache2/conf.d/userdata/std/2_4/{user}/{domain}/{includename}.conf (for SSL)
When done run this 3 commands to update the configs
/scripts/verify_vhost_includes
/scripts/ensure_vhost_includes --user={user}
/scripts/rebuildhttpdconf
Make sure to backup your httpd config before this step above
Finally restart your httpd and you should be good

Selected the second PHP version, but on the command line it's still the first

I have installed 2 PHP version in my DirectAdmin environment: php5.5 (php1_release) and php7.1 (php2_release). Now I have one user set to php 7.1 with the PHP Versions Selector under Domain Setup. On the website in the browser it seems to work well, phpinfo tells me that php7.1 is running for this domain. But when I use composer from the command line it gives an error because it detects php5.5:
Any ideas how to solve this?
Try compiling with the full path of the php binary - "/usr/local/php70/bin/php70" - instead of just "php". Now command will be like that.
/usr/local/php70/bin/php70 composer.phar update
Important note : PHP binary Path will be different for each server.

Linux XAMPP suddenly requires 32 bit compatibility library

I have been working with linux's version of XAMPP (named LAMPP) for about 3 months now and up until tonight XAMPP has worked fine, but suddenly when I tried to run the command
sudo xampp stop
it gave me this error message:
XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.
and since then any time I try to run any of the following commands:
sudo xampp start
sudo xampp stop
sudo xampp restart
I get the same message
I want to know why I got this message because xampp has been working flawlessly up until now and in fact, less than 30 minutes ago, I typed sudo xampp start and xampp started up normally and I was able to access localhost/phpmyadmin/
Here is some other info that may be useful:
-My OS is Arch Linux
-I am using the xfce desktop environment
-In the time between starting xampp successfully and trying to stop xampp when I got the error message above, I was trying to get the php mail() function to work by following the steps on this page http://www.absolutelytech.com/2010/07/18/howto-send-emailsusing-mail-function-from-localhost-in-php-through-msmtp-using-gmail-account-on-linux/ and I had just successfully finished step 1 and successfully sent the test email to myself.
-also, when I first got the aforementioned error message, I was still able to access pages via localhost (for instance I had a php file at /opt/lampp/htdocs/Brown/index.php that I could access successfully by typing localhost/Brown/index.php even after I was getting the error message) but then I tried to restart my computer to see if that might fix the issue and now I can't start xampp to begin with.
Please someone help me with this and feel free to ask any follow-up questions if that will help
I figured out my own issue. For anyone who sees this question, I had made a few changes to my php.ini file in attempts to get php's mail() function to work and I wanted to start fresh, so I moved php.ini to php_old.ini and copied a file named php.ini-pre1.7.2 to php.ini thinking that php.ini-pre1.7.2 was a file containing the default configuration of php.ini in case one might want to roll back to the defaults, but instead it is something entirely different. My issue was completely fixed when I moved php_old.ini back to php.ini
2021 and the same happened to me after trying to match php.ini seetings between a Windows environment and a Ubuntu 20.04 one. Everywhere I saw it told me to comment a section in the /opt/lampp/lampp file but it messed up my installation and I lost track of what was wrong. After re-installing LAMPP I matched the settings one by one restarting with sudo opt/lampp/lampp restart at each modification. The culprit was:
browscap="C:\xampp\php\extras\browscap.ini"
This line has to be stay commented (just put a semicolon at the start of the line), if you need it then this workaround may help you. Cheers!

phpMyAdmin downloads a file when I try to open it after installing LAMP on my 12.04 LTS system

I just installed LAMP on my 12.04 LTS system, but whenever I try to run phpMyAdmin, a stranage file downloads. Anyone got a solution for such an issue?
As it seems to me, your apache could have not been started. To check is if it running you can use one the following command (in console/terminal).
pgrep apache
Any output means it is running, no output means it is not.
If it is not running, start it and then try to access phpMyAdmin again.
To start it:
[sudo] /etc/init.d/apache2 start
Where of course, sudo in brackets is optional (but I would recommend using it).
More information would be definitively appreciated. For example what kind of file is downloaded.

Cron is not executing latest file version

I had setup a php file to run via cron.
The problem i got now is after adding to cron what ever change i made to the php file is not taken in considertion.
it keep executin my first version of that file.
i got this problem after updating WHM.
When i googled someone said it might be because of jailed shell access.
i disabled that from WHM and restared the server.
Still no luck...
Any help much apreciated...
Thanks in advance

Resources