Issues with uninstalling Blackfire on Laravel Forge - laravel

I'm trying to remove the Blackfire profiler that was installed on the server via Laravel Forge.
Under "Integrations" I clicked "Uninstall" on Blackfire and restarted PHP, but now I'm getting the following warning on Sentry:
Core Warning: PHP Startup: Unable to load dynamic library 'blackfire.so' (tried: /usr/lib/php/20190902/blackfire.so (/usr/lib/php/20190902/blackfire.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/blackfire.so.so (/usr/lib/php/20190902/blackfire.so.so: cannot open shared object file: No such file or directory))
I have checked the php.ini file and can find no reference to Blackfire.

Search for references in phpinfo:
php -i | grep 'blackfire'
Output:
/etc/php/7.4/cli/conf.d/99-blackfire.ini
Find out what is trying to load it:
php --ini
Output:
Scan for additional .ini files in: /etc/php/7.4/cli/conf.d
Delete config file:
sudo rm /etc/php/7.4/cli/conf.d/99-blackfire.ini
Repeat for fpm version:
sudo rm /etc/php/7.4/fpm/conf.d/99-blackfire.ini
Restart PHP

Related

composer require yajra/laravel-oci8:^8 in laravel 8

PHP version 7.3.22
Running on Laravel Framework version 8
root#df77c47e6f1e:/var/www/oracle-laravel-v8# composer require yajra/laravel-oci8:^8
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: /usr/lib/php/20180731/oci8_12c (/usr/lib/php/20180731/oci8_12c: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/oci8_12c.so (/usr/lib/php/20180731/oci8_12c.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /usr/lib/php/20180731/pdo_oci (/usr/lib/php/20180731/pdo_oci: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_oci.so (/usr/lib/php/20180731/pdo_oci.so: cannot open shared object file:
No such file or directory)) in Unknown on line 0
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.
Run composer self update command and clear composer cache
composer self-update
Then
composer clear-cache
There is nothing wrong about laravel and composer here. It seems that your system's php installation/configuration is wrong (pdo_oci extension is missed or misconfigured) so it can't process anything, even fails at composer startup.
Composer itself is package manager written in php. And laravel is framework written in php. So it's laravel is running on php, not vice versa.

Using Composer to install mailparser, why am I getting an error that allow_url_fopen must be enabled when it already is enabled?

I am trying to install this PHP mailparser. I have Composer installed and the required mailparse extension is also installed. However, when I run:
composer require php-mime-mail-parser/php-mime-mail-parser
I get the following error:
[Composer\Downloader\TransportException] The
"https://repo.packagist.org/packages.json" file could not be
downloaded : allow_url_fopen must be enabled in php.ini (https://
wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
However, I've checked php.ini and it clearly says it's enabled, i.e.
allow_url_fopen = On
How could I get that specific of an error about needing to enable allow_url_fopen even though it definitely IS enabled?
Run this command:
php -d allow_url_fopen=on <composer_path> <composer_arguments>
Replace <composer_path> with the direct path to the composer executable (e.g. /opt/cpanel/composer/bin/composer) and <composer_arguments> with the arguments you are passing to composer (e.g. require php-mime-mail-parser/php-mime-mail-parser).
This works for me:
php -d allow_url_fopen=1 /opt/cpanel/composer/bin/composer install

Memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file

Situation: I installed memcached on a CenTOS 5 (64 bit). I also ended up installing some PHP plugins using PECL, though they're unnecessary now.
Problem:When I execute
/etc/init.d/memcached start
I get the following error:
Starting memcached: memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
But the file libevent-2.0.so.5 is present in /opt/couchbase/lib/.
Should it be there in some other folder ? How to get memcached to start ?
/opt/couchbase/lib will not be set on your system library path by default. That's why your unable to find libevent when running /etc/init.d/memcached.
To quickly solve this you can just run the command as follows:
LD_LIBRARY_PATH=/opt/couchbase/lib /etc/init.d/memcached
or to solve this over the long term add the following file (assuming your using centos):
/etc/ld.so.conf.d/couchbase.conf
and in that file add the path "/opt/couchbase/lib". Then run ldconfig and re-run the command to start memcached.
sudo ln -s /usr/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6
for libevent-2.0.so.5 the same.

Installation of extension in PHP

I'm trying to install extension to PHP 5.3.6 on Ubuntu 11.10.
Extension is: php-protobuf from https://github.com/allegro/php-protobuf.
First I compiled it: phpize, ./configure, make then finally sudo make install. I got:
Installing shared extensions: /usr/lib/php5/20090626/
ziel#ziel:/usr/lib/php5/20090626$ ls -la protobuf.so
-rwxr-xr-x 1 root root 113599 2013-06-13 20:48 protobuf.so
In /etc/php5/apache2/php.ini I set:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
extension_dir = "/usr/lib/php5/20090626/"
extension="/usr/lib/php5/20090626/protobuf.so"
But php -m says that that no protobuf extension is loaded.
[SOLVED]
I was doing everything OK. When I execute code via apache it worked. I realized that php from console need php.ini included.
Just specify "protobuf.so" on the extension_dir INI entry. (check Apache error log file too)
About the php cli, check out where php.ini is being searched for.
php -i | grep .ini

unable to run laravel 4

I thought it was about time to look at a PHP Framework so I chose laravel. However, getting it running is causing me grief.
I followed the video from nettuts installing laravel 4 and at 5.05mins into the video he uses the php command-line server command (available from 5.4) php -S localhost:8888 -t public/ followed by confirming that it works via localhost:8888 in the browser which displays 'Hello Wolrd!'
I have XAMPP installed and my version of PHP is 5.3.15. I attempted to test it by doing http://localhost/learning-laravel/public/
At this point I have already downloaded composer and installed the dependancies successfully.
But I keep getting the following error:
Warning: require(/Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/autoload.php on line 17
Fatal error: require() [function.require]: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/autoload.php on line 17
Inside my learning-laravel folder I do have bootstap/autoload.php
Can someone please help? Thanks.
I had another look at my folder structure and I noticed that composer had not run correctly and there were missing files. I've reinstalled it and it appears to be working.

Resources