failed to install php-integrator-base package in atom editor - php

I am new on this editor and I would like to try it for php project.
I am trying to configure this package php-integrator-base in my atom ide, but I have this error:
The socket connection with the PHP server could not be established.
This means the PHP server could not be spawned. This is most likely an
issue with your setup, such as your PHP binary not being found, an
extension missing on your system, ...
This is my setup for this package:
This my php verion on my ubuntu distrib:
Anyone else have the same issue with this package ? Where am I wrong ?
EDIT
Since I have make the update of the package today I always have the same error but another one occured.
Indeed, an error message appears to notice that:
Core installed failed
When I start the atom editor I have this message too:

If you are on Unix system then go to :
cd $HOME/.atom/packages/php-integrator-base/core/
then you should have a directory with num version as name like 2.X.X. So :
cd 2.1.0 and ../composer.phar install

I am relevantly new to this IDE as well and had errors with installation of php-integrator-base. I am using Windows and it turned out that it was an issue with my environmental path. Try the following steps:
Add your Git binary path to your environmental path
Enable sqlite on your php.ini file by adding these: extension=php_sqlite3.dll and extension=php_pdo_sqlite.dll
If above steps do not work, try posting an issue at their GitHub repo.

There is a better solution, which solves this "identified" issue and others only visible when running Atom in --dev mode.
Sadly nobody ever pointed to the fact (or noticed) this issue is caused by packages differences in between PHP 7.0 and PHP 7.1. For some reason, for PHP 7.1 some packages still reference items related to PHP5.6, while some other packages are expecting everything to be PHP 7.x related.
The solution is to upgrade the PHP 7.0x to PHP 7.1.
In Ubuntu environments you can do that by running these commands:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt remove php7.0 (optional, only if you want to uninstall PHP7.0)
sudo apt install php7.1
Simply restart Apache by running:
sudo service apache2 restart
Then check your PHP version to confirm it has been upgraded:
php -v
You should get an output like this:
PHP 7.1.8-2+ubuntu16.04.1+deb.sury.org+4 (cli) (built: Aug 4 2017 13:04:12) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.8-2+ubuntu16.04.1+deb.sury.org+4, Copyright
(c) 1999-2017, by Zend Technologies
You may have to re-enable some extensions after upgrading to PHP 7.1. Atom may complain about these in specific (mbString, SQLite and DOM). Simply run these commands to install/activate them:
sudo apt install php7.1-mbstring
sudo apt install php7.1-sqlite
sudo apt install php7.1-xml
Don't forget to reactivate your old extensions as well (if any). For PHP 7.1 in most cases it is the same "command" just changing "php7" (or "php") to "php7.1".
Once you are done with PHP, navigate to Atom's PHP Integrator folder and check if the folder "3.0.0" exist:
.atom/packages/php-integrator-base/core/3.0.0/
If it doesn't exist go to https://gitlab.com/php-integrator/core/tree/3.0.0, download it and extract the contents of the compressed file in the 3.0.0 folder (you may have to create it):
Then, from inside .atom/packages/php-integrator-base/core/ you run:
composer install
Now, finally, Composer will be able to find the right packages and install all required dependencies.
Simply say "good bye" to the PHP Integrator errors that have been haunting you lately and enjoy your Atom, once again fully functional as it should be.
I hope it helps some fellow friends stop wasting time with lots of proposed solutions that exist online which in reality won't fix the real core of the problem. ;)

Following #Rei suggestion, I make an issue on theri github repo here.
To solve my problem, I follow step by step a manual installation of the package and then use composer inside the package itself to install the core folder.

If ./composer.phar install fails with a "missing sqlite extension", install php-sqlite extension:
sudo apt-get install php-sqlite3

Related

pecl fails installing mongodb driver on Apple Silicon (M1)

I have php 7.4 installed on my macbook pro m1
% php -v
PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies
I'm trying to install the mongodb driver running:
sudo pecl install mongodb
But fails after a while:
mp/pear/temp/mongodb/src/contrib/ -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/mongodb/php_phongo.c -fno-common -DPIC -o .libs/php_phongo.o
In file included from /private/tmp/pear/temp/mongodb/php_phongo.c:29:
In file included from /opt/homebrew/Cellar/php#7.4/7.4.15_1/include/php/ext/spl/spl_iterators.h:24:
/opt/homebrew/Cellar/php#7.4/7.4.15_1/include/php/ext/pcre/php_pcre.h:25:10: fatal error: 'pcre2.h' file not found
#include "pcre2.h"
^~~~~~~~~
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed
I tried with
arch -x86_64 sudo pecl install mongodb
but results in the same error.
Somebody knows how can I solve this please? Or if I can install the mongodb driver without using pecl. Thanks in advance.
I have finally solved my problem.
I followed these steps from https://github.com/mongodb/mongo-php-driver/issues/1159
After installing a newer PHP version where previously I used 7.3.24 and updated to 7.4.16.
Still had the same issue but diffrent file:
fatal error: 'pcre2.h' file not found #include "pcre2.h"
From this error I tried to check the files in the MacOs Big Sur File system and in the end I found where the pcre2.h is located, and oddly it was being called in the pcre folder, so I manually copied from the pcre2 folder to pcre
The solution that I used:
$cp /opt/homebrew/Cellar/pcre2/10.36/include/pcre2.h /opt/homebrew/Cellar/php\#7.4/7.4.16/include/php/ext/pcre/pcre2.h
Then, I installed mongodb using
$brew install mongodb
After that, I once again tried
$sudo pecl install mongodb
Finally, it worked. However, I'm not sure if this is a good way to solve the problem by manually adding a header file to the directory.
(Sorry I'm still new to the MacOs Environment, just bought a mac mini m1 last week for developing my programming skills)
If you were to install php multiple versions from homebrew make sure you are using the current version as you wanted to. You could check the version by using which php.
To switch from 7.4 to 5.6
$brew unlink php#7.4
$brew link php#5.6 --force
credits: https://www.markhesketh.com/switching-multiple-php-versions-on-macos/
New error
Success Installation:
There is a simpler way to fix the installation issue than symlinking the header file into PHP sources. When running pecl install, you can provide additional compile arguments via the CFLAGS environment variable. So, on the Apple Silicon platform, you can use the following command to get the extension to compile:
CFLAGS=-I/opt/homebrew/include pecl install mongodb
Note that this is only necessary on Apple Silicon, not on x64. It also works for other extensions that fail because of similar errors (e.g. apcu)
I had the same issue with PHP 7.3, I solved it just by running the following commands:
cp /opt/homebrew/Cellar/pcre2/10.38/include/pcre2.h /opt/homebrew/Cellar/php#7.3/7.3.31/include/php/ext/pcre/pcre2.h
Then installed it successfully:
sudo pecl install mongodb
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1)
My errors: fatal error: 'pcre2.h' file not found
The solution that I used:
1. brew install pcre2
2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h
Please check your path again when use `ln -s`
3. sudo pecl install mongodb
See more: Install pecl pear on MacOs - Link
Success Installation:
Hope it help you :) Thanks
cp /Applications/MAMP/Library/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/pcre2.h
then run
sudo pecl install mongodb
If you use MAMP,
Based on #Kelwin Tantono's answer follow instructions to install mongodb then,
Firstly, check for the location of pcre2.h file by
cd /opt/homebrew/Cellar/pcre2/
In this directory find the folder with ls command, in my case it was 10.40 .
Change 10.40 value in the below code with the result of ls command.
Then, check your php version with moving to php directory at MAMP by
cd /Applications/MAMP/bin/php/
Change php8.0.8 value in the below code with your desired php version.
cp /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre
Now you can install mongodb extension with below command after changing your working directory to
cd /Applications/MAMP/bin/php/php8.0.8/bin
sudo pecl install mongodb
Now, you should add extension=mongodb.so to php.ini file with
echo "extension=mongodb.so" > /Applications/MAMP/bin/php/php8.0.8/conf/php.ini
Do not forget to change php version.

PHP 7.4 and Ubuntu 18 - PHP Startup: Unable to load dynamic library 'curl.so'

I'm using the ondrej ppa for PHP and am running Ubuntu 18. Running php -v gives me the following output:
PHP Warning: PHP Startup: Unable to load dynamic library 'curl.so' (tried: /usr/lib/php/20190902/curl.so (/usr/lib/php/20190902/curl.so: symbol curl_mime_addpart version CURL_OPENSSL_4 not defined in file libcurl.so.4 with link time reference), /usr/lib/php/20190902/curl.so.so (/usr/lib/php/20190902/curl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.4.2 (cli) (built: Jan 23 2020 11:21:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.2, Copyright (c), by Zend Technologies
Basically, I can't run any composer commands because a lot of libraries depend on curl, and apparently it isn't being found. I've done the following:
Tried to update everything (sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get install php7.4-curl). This doesn't fix the issue.
Restarted apache despite this being the cli version.
Double checked where it's trying to find the library. What's weird is that /usr/lib/php/20190902/curl.so is a valid path and the file is definitely there.
Running php --ini also shows that the curl extension is loaded:
Configuration File (php.ini) Path: /etc/php/7.4/cli
Loaded Configuration File: /etc/php/7.4/cli/php.ini
Scan for additional .ini files in: /etc/php/7.4/cli/conf.d
Additional .ini files parsed: /etc/php/7.4/cli/conf.d/10-mysqlnd.ini,
...more ini files...
/etc/php/7.4/cli/conf.d/20-curl.ini,
...more ini files...
I'm unsure how to fix this as the file it supposedly can not find is exactly where it says it looked, and everything is up to date.
For anyone with this issue, the answer is here.
Basically, the libcurl that was installed on my Ubuntu machine clashed with the official one that Ubuntu has? Weirdly it was only affecting php7.3 and 7.4 and not 7.2. Anyways, I renamed the libcurl module like so:
mv /usr/local/lib/libcurl.so.4.4.0 /usr/local/lib/libcurl.so.4.4.0.backup
And by running php -m, I could verify that the cURL module was now enabled.
I found that if I did:
apt search | more
(the pipe is for long lists)
that I could find the php package name that I needed.
For example:
apt search curl
told me that the name of the package for my php version is 'php7.2-curl'
So, all I had to do was sudo apt install php7.2 curl.
I repeated this (some names require a little googling, and/or some apt search creativity.
I solved it by doing this:
Uninstall curl:
apt remove php7.4-curl
New install:
apt install php7.4-curl
I have now all right.
After trying to run composer update things were failing because the deps where from php -v 7 while I was using 8.
composer install --ignore-platform-reqs
worked for me

can't create a Laravel project because mcrypt extension is missing

OK, I have seen many posts about this, and I have spent the entire day working through them to solve this issue, with no success.
I am trying to create a Laravel project. I am using a Mac (Yosemite), which is running PHP 5.5.14. There is also an older version of PHP on the machine. When I try to create a project from the command line using "laravel new projectname", no errors are reported, but the command just creates an empty folder named with the project name. I get the "Crafting application..." and "Application ready! Build something amazing" messages but, again, only an empty folder.
If I try to use this command:
composer create-project laravel/laravel projectname
I get this:
Installing laravel/laravel (v5.0.16)
- Installing laravel/laravel (v5.0.16)
Downloading: 100%
Created project in projectname
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for laravel/framework v5.0.16 -> satisfiable by laravel/framework[v5.0.16].
- laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
In the terminal, if I enter this:
which php
I get: /usr/bin/php
/usr/bin/php -v
I get:
PHP 5.5.14 (cli) (built: Sep 9 2014 19:09:25)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
I used homebrew to install autoconf and mcrypt with this command:
brew install autoconf mcrypt
If I run that command again, I get:
Warning: autoconf-2.69 already installed
Warning: mcrypt-2.6.8 already installed
Since I kept getting the error, I assumed it was installed in the wrong place so, I compiled and installed mcrypt myself using these instructions:
[Install mcrypt php extension][1]. I used PHP version 5.5.14 during the install. Mcrypt was installed in this directory: /usr/lib/php/extensions/no-debug-non-zts-20121212/
I have restarted Apache. I have checked my .bash_profile to make sure /usr/bin is in my Path.
If I create a page with phpinfo() and view it in my browser, I see that mcrypt is listed in the "Module Authors" section of the page. It just lists the names of the people who created the module.
I am stumped. I look forward to any suggestions that people might offer (I really don't want to install a virtual box, or anything like that. Surely, I can get this module installed in the right place!)
Thanks very much!
I got this exact same problem too.
You have to find php.ini for php cli and add extension=mcrypt.so
My system is running LAMPP server with preinstalled PHP. So, here's what I do:
Install mcrypt extension
I tried both:
sudo apt-get install mcrypt
sudo apt-get install php5-mcrypt
Configure php.ini for CLI
Then, edit php.ini located in /opt/lampp/etc/php5/cli/php.ini add extension=mcrypt.so on Dynamic Extension section (anywhere is fine I think). Don't forget to restart your server.
Try using composer to install laravel
Now, you can run whatever method you want to install laravel. I download Laravel 5 manually, unzip, then install using composer install command. I think your command composer create-project laravel/laravel projectname would've run smoothly too.
References:
here
mac users install brew and then enter
brew install php56-mcrypt
in terminal
EDIT
if you get any error using above line then try this command
brew install homebrew/php/php56-mcrypt
Please following the step :
cd /etc/php5/cli/conf.d
ln -s ../../mods-available/mcrypt.ini 20-mcrypt.ini
Worked for me.
For MAC users,
brew install homebrew/php/php56-mcrypt

Laravel 4 - Error while running `composer install`

The problem:
I have installed Composer and followed the Quick start guide in the Laravel 4 documentation.
I get the following error when I run composer install or composer update:
Script php artisan optimize handling the post-install-cmd event
returned with an error...
I tried to run the following composer command:
composer create-project laravel/laravel myproject --prefer-dist
Or use their laravel.phar:
laravel new myproject
Or get the zip version from git: https://github.com/laravel/laravel?source=c
And I still fail to update via composer.
Additional information:
My PHP version on my Mac is:
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0,
Copyright (c) 1998-2013 Zend Technologies
PHP version on MAMP: 5.4.10
I found some solutions on Google / Stack Overflow but those did not work well in my case.
It says:
MCrypt PHP extension required
So it looks like you're missing the Mcrypt extension, which is required by Laravel (actually, I think it's used only by the Authentication class for password handling, not for the rest of the components of the framework).
I haven't got a Mac, but the command to install it should be something like this, using Homebrew
brew tap josegonzalez/php
brew install mcrypt php54-mcrypt
These links might help you:
http://www.jorble.com/2013/04/install-php-mcrypt-in-macosx/
http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-9-mavericks-development-server/
Having the setting xdebug.scream = 1 in the configuration was the cause of the problem for me. I fixed it by doing the following:
Find XDebug configuration file.
$ sudo find / -name xdebug.ini
Edit file using any text editor.
$ sudo vi /your_path/xdebug.ini
Set xdebug.scream = 0
Reload the server (Apache/Nginx/whatever).
$ sudo service nginx reload
You might have Mcrypt installed already on your computer, if you are using MAMP or any other application. So, you don't need to install Mcrypt again. Add the following code to a php file and place it in your htdocs directory. See the info about the PHP you are running. You can see whether Mcrypt is already installed or not.
<?php
phpinfo();
If it shows Mcript, then do the following:
Check which PHP version you are using. You can see different directories for different PHP versions in this directory: /Applications/MAMP/bin/php/.
Move to the user's home directory. Use this command on terminal: cd ~.
Edit (or create a new one if not exists) .bash_profile file.
Add the following line:
where php5.5.10 is the directory of the PHP version you are using.
export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH
Now restart your computer. And you can use php artisan command of Laravel.
Source of information: Laravel requires the Mcrypt PHP extension

php GD library error in ubuntu

I am using ubuntu 11.04 and when I am opening terminal and typing php -a it is showing some error like this
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/gd.so' - /usr/lib/php5/20090626/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
I think there is some problem with GD library.Is there any option to solve it?
Yeah. Just try:
sudo apt-get install php5-gd
You probably will have to remove the offending line in your php.ini, either in php.ini or in
/etc/php5/conf.d/gd.ini maybe.
Probably something like
sudo apt-get install php-gd
should do it, if not try
apt-cache search php | grep gd
For me the solution was:
locate --regex /mcrypt[.]so\$ /gd[.]so\$ /suhosin[.]so\$ /pdo_mysql.so\$ /pdo[.]so /mysqli[.]so\$ '/php5/.*/mysql[.]so$'
Which returned the location of all the libraries that my php5 install was having trouble finding:
/usr/lib/php5/20090626+lfs/gd.so
/usr/lib/php5/20090626+lfs/mcrypt.so
/usr/lib/php5/20090626+lfs/mysql.so
/usr/lib/php5/20090626+lfs/mysqli.so
/usr/lib/php5/20090626+lfs/pdo.so
/usr/lib/php5/20090626+lfs/pdo_mysql.so
I was a little worried that these look they might be old versions, but I used their paths anyway. Stefgosselin identified the location of the ini files, /etc/php5/conf.d/. I modified them all. The command below will modify all of the *.ini files there, so make sure all of yours really need modifying. Obviously you need to use the target path you discovered with the locate command in place of mine, /usr/lib/php5/20090626+lfs/:
sudo sed -ri -e "s|^(extension=)(\w{2,10}[.]so)$|\1/usr/lib/php5/20090626+lfs/\2|g" /etc/php5/conf.d/*.ini
Before finding this solution I tried several apt-get purge and apt-get reinstall commands without luck. I'm not sure, but my problem may have originated with installation of zend from source or phpmyadmin with aptitude. It never caused any php errors, just the annoying warning you mentioned. Finally php5 can launch without errors:
php5 --version
gives ...
PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May 2 2011 23:18:30) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
sudo apt install php-gd will work but the thing is it will download the plugin for the latest PHP version.
If your PHP version is not the latest, then you can add version in it:
# PHP 7.1
sudo apt install php7.1-gd
# PHP 7.2:
sudo apt install php7.2-gd
# PHP 7.3
sudo apt install php7.3-gd
# PHP 7.4 (latest)
sudo apt install php-gd

Categories