How to bring php5 in yocto image? - yocto

In my yocto development kit I included meta-openembedded/meta-oe in conf/bblayer.conf for meta-raspberrypi but I can't able to see php5 at the final image in /etc/php.I tried giving bitbake php and also included IMAGE_INSTALL_append = " php" nothing works.Can anyone please help me to include it in final image.

Bydefault Poky-sumo branch gives php7.2 and if you want php5 use
PREFERED_PROVIDER_VERSION_php ="5.6.35"
Below are the packages provided by php recipe
PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}
you can all all required above packages like below example.
IMAGE_INSTALL_append = " php-cli php-cgi php-pear"

You might find it's installed just not as you are expecting. Using Yocto version Sumo and the [meta-oe php 7.2.10][1] I added PHP to my image using:
IMAGE_INSTALL += "php php-cli php-fpm"
I found it bitbaked and installed fine but didn't generate the /etc/php folder or php.ini.
To see if it is installed:
php -v
Once you are in your OS create a file test.php and in it add:
<?php echo phpinfo(); ?>
Then run the below tells you the path it is expecting php.ini:
php test.php | grep php.ini

Related

getting "command not found: phalcon" after successfully installing phalcon/devtools via composer

Software: MacOS
Phalcon: 5.0.0RC4
Phalcon/Devtools: 4.2.0
I have newly created phalcon 5.0 repository.
I successfully ran
composer install
composer require phalcon/devtools
however when I try to run a phalcon command I get
zsh: command not found: phalcon
I checked if it had installed successfully and tried reinstalling as well.
php -m returns that phalcon is installed too:
php -m | grep phalcon
phalcon
and the extension is there in the php.ini file
extension="phalcon.so"
Am I missing anything?
The phalcon/devtools package links the phalcon.php executable to your composer bin-dir.
Get it as follows:
composer config bin-dir
It defaults to ./vendor/bin. The installed symlink is ./vendor/bin/phalcon.php.
You can run the command as follows:
./vendor/bin/phalcon.php [..]
To ease access you can automatically add ./vendor/bin to your PATH (i.e. with direnv)
# .envrc
PATH_add ./vendor/bin
or you can create a ./bin dir in your project directory and symlink phalcon.php as phalcon into it.
mkdir ./bin
ln -sfn ./vendor/bin/phalcon.php ./bin/phalcon
Now you can add ./bin to your PATH:
export PATH="${PWD}/bin:${PATH}"
And invoke the phalcon CLI with:
phalcon [..]
Adding to Nicolai's answer, it is also possible to just call phalcon like so:
vendor/bin/phalcon commands
In my case, I didn't want to be able to call phalcon globally so I copied the file into the project directory and named it phalcon4
Then I edited the paths inside the file like so
$addpath = '/vendor/phalcon';
$GLOBALS['_composer_bin_dir'] = __DIR__ .$addpath;
$GLOBALS['_composer_autoload_path'] = __DIR__ .$addpath. '/..'.'/autoload.php';
// the rest of the code
include __DIR__ .$addpath. '/..'.'/phalcon/devtools/phalcon';
Now I can run the command like this:
php phalcon4 commands
Still, devtools 4.2 cannot run with phalcon 5 so the command just threw an error.

dev packages not getting included in Yocto SDK

We are generating Yocto SDK using the following command: bitbake -c populate_sdk <image-name>
Yocto Branch : Dunfell
We don't see header files getting included in the SDK, for example we have libmodbus part of IMAGE_INSTALL, we don't see modbus.h file in SDK which is present in libmodbus-dev package
Could you execute the command below so we can verify your setup:
bitbake -e <image-name> | grep SDKIMAGE_FEATURES
Development packages are automatically included into SDK when they are installed into the image when SDKIMAGE_FEATURES variable defines it
SDKIMAGE_FEATURES = "dev-pkgs staticdev-pkgs"
https://www.yoctoproject.org/docs/3.1/mega-manual/mega-manual.html#var-SDKIMAGE_FEATURES

How to enable pcntl extensions in MAMP pro?

I am using laravel/horizon with Osx MAMP pro
when I run the composer it requires laravel/horizon:~1.0
it shows a message -
laravel/horizon v1.0.8 requires ext-pcntl * -> the requested PHP
extension pcntl is missing from your system.
I checked the folder /Applications/MAMP/bin/php7.1.1/php/ext,it doesn't contain pcntl extension.
How can I install that?
download php from http://www.php.net/releases/
tar -xzvf php-7.2.1.tar.gz
cd php-7.2.1/ext/pcntl
/Applications/MAMP/bin/php/php7.2.1/bin/phpize
as # drewjoh metioned ./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.1/bin/php-config --prefix=/Applications/MAMP/bin/php/php7.2.1/bin/php
make && make install
the terminal shows
Installing shared extensions: /Applications/MAMP/bin/php/php7.2.1/lib/php/extensions/no-debug-non-zts-20170718/
open MAMP PRO menu->File ->Edit Template->PHP->7.2.1 add extension=pcntl.so at the end of the php.ini file .
run the command php --ri pcntl and shows
pcntl pcntl support => enabled
Just an addition. Perhaps you followed the above step and still can't get it installed to /Applications/MAMP/bin/php/php7.2.1/lib/php/extensions/no-debug-non-zts-20170718/. Here is something I did that worked for me.
I added the --with-php-config before the --prefix flag and it worked. See step below.
download your MAMP php version from http://www.php.net/releases/ Mine is php7.2.22
Open your terminal and cd into your download folder. Then run this command to decompress the tar.gz file
tar -xzvf php-7.2.22.tar.gz
Cd into the pcntl directory after decompressing.
cd php-7.2.22/ext/pcntl
Run the next line from your terminal to Configure for PHP Api, Zend Module Api, and Zend Extension Api.
/Applications/MAMP/bin/php/php7.2.22/bin/phpize
Then run
./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.22/bin/php-config --prefix=/Applications/MAMP/bin/php/php7.2.22/bin/php; make && make install;
You should see
Installing shared extensions: /Applications/MAMP/bin/php/php7.2.22/lib/php/extensions/no-debug-non-zts-20170718/
Then you can repeat the last two steps above.
You can download the precompiled extensions from here https://github.com/khanakiaphp/mamp_extensions

Problems running init as part of yii 2 install

I am installing yii 2 on a mac. I have mamp pro (3.0.7.3 latest) when i go to the command line and run.
php init i get a message saying
The mcrypt PHP extension is required by Yii2.
I checked the server using phpinfo() and it shows mcypt enabled. I checked the php.ini and it is listed and the file exists in the referenced directory.
any ideas anyone ??
This probably means that your php CLI (Command Line Interface) does not use the same php.ini than MAMP. You could use something like php -c /path/to/mamp/php.ini to be sure to use the same php.ini.
Or try the following command : php --ini, this will show you configuration file names, e.g. :
Configuration File (php.ini) Path: /path/to/php/conf
Loaded Configuration File: (none)
You could then make a symbolic link :
cd /path/to/php/conf
sudo ln -s /path/to/mamp/php.ini php.ini

Install ionic framework.

I have installed the module with node version v0.10.22
sudo npm install -g ionic
But know when I am trying to start an new application I am getting a
-bash command not found
which ionic
gives me nothing, do I have to add the path to on the $PATH variable ?
How did you installed npm? If you used homebrew then npm won't put npm files accessible by users.
Add export PATH=/usr/local/share/npm/bin:$PATH to your .bashrc/.bash_profile/.zshrc file and it should work fine.
Also refer this: Bower: "command not found" after installation