Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Compile from master fails with error ext/swoole/php_swoole.h: No such file or directory #3

Closed
GhaziTriki opened this issue Apr 29, 2019 · 14 comments

Comments

@GhaziTriki
Copy link

Doing make -j 4 generated the following error.

/bin/bash /home/riadvice/async-ext/libtool --mode=compile g++  -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11   -c /home/riadvice/async-ext/swoole_async.cc -o swoole_async.lo
/bin/bash /home/riadvice/async-ext/libtool --mode=compile cc  -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /home/riadvice/async-ext/swoole_mysql.c -o swoole_mysql.lo
/bin/bash /home/riadvice/async-ext/libtool --mode=compile cc  -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /home/riadvice/async-ext/swoole_redis.c -o swoole_redis.lo
/bin/bash /home/riadvice/async-ext/libtool --mode=compile cc  -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /home/riadvice/async-ext/swoole_msgqueue.c -o swoole_msgqueue.lo
libtool: compile:  cc -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /home/riadvice/async-ext/swoole_redis.c  -fPIC -DPIC -o .libs/swoole_redis.o
In file included from /home/riadvice/async-ext/swoole_redis.c:17:0:
/home/riadvice/async-ext/php_swoole_async.h:26:35: fatal error: ext/swoole/php_swoole.h: No such file or directory
compilation terminated.
libtool: compile:  g++ -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /home/riadvice/async-ext/swoole_async.cc  -fPIC -DPIC -o .libs/swoole_async.o
libtool: compile:  cc -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /home/riadvice/async-ext/swoole_msgqueue.c  -fPIC -DPIC -o .libs/swoole_msgqueue.o
libtool: compile:  cc -I. -I/home/riadvice/async-ext -DPHP_ATOM_INC -I/home/riadvice/async-ext/include -I/home/riadvice/async-ext/main -I/home/riadvice/async-ext -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/home/riadvice/async-ext -I/home/riadvice/async-ext/include -I/usr/include/php/20180731/ext/swoole -I/usr/include/php/20180731/ext/swoole/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /home/riadvice/async-ext/swoole_mysql.c  -fPIC -DPIC -o .libs/swoole_mysql.o
/home/riadvice/async-ext/swoole_msgqueue.c:17:24: fatal error: php_swoole.h: No such file or directory
compilation terminated.
In file included from /home/riadvice/async-ext/swoole_async.cc:17:0:
/home/riadvice/async-ext/php_swoole_async.h:26:35: fatal error: ext/swoole/php_swoole.h: No such file or directory
compilation terminated.
In file included from /home/riadvice/async-ext/swoole_mysql.c:19:0:
/home/riadvice/async-ext/php_swoole_async.h:26:35: fatal error: ext/swoole/php_swoole.h: No such file or directory
compilation terminated.
Makefile:198: recipe for target 'swoole_redis.lo' failed
make: *** [swoole_redis.lo] Error 1
make: *** Waiting for unfinished jobs....
Makefile:194: recipe for target 'swoole_async.lo' failed
make: *** [swoole_async.lo] Error 1
Makefile:196: recipe for target 'swoole_mysql.lo' failed
make: *** [swoole_mysql.lo] Error 1
Makefile:200: recipe for target 'swoole_msgqueue.lo' failed
make: *** [swoole_msgqueue.lo] Error 1
@mansoncui
Copy link

Are you ready to solve it

@scil
Copy link

scil commented Jul 6, 2019

same error.

@nicoren-te
Copy link

+1

@francescozanoni
Copy link

francescozanoni commented Jul 13, 2019

My solution is by installing Swoole extension from source, not from PECL: this makes Swoole Async extension install (from source, of course) without issues.

sudo apt-get install php-dev

git clone https://github.com/swoole/swoole-src
cd swoole-src/
phpize
./configure
make -j 4
sudo make install

git clone https://github.com/swoole/ext-async
cd ext-async/
phpize
./configure
make -j 4
sudo make install

# Add the two following lines to file /etc/php/7.2/cli/php.ini
# extension=swoole.so
# extension=swoole_async.so

php -m | grep swoole
# swoole
# swoole_async

To be honest, I don't know why Swoole installation via PECL makes Swoole Async installation fail.

I have PHP 7.2 on Ubuntu 18.04, completely fresh install.

Hope this helps!

@de-paco
Copy link

de-paco commented Jul 16, 2019

Have same error on make -j 4 stage, i have installed swoole extension already

@francescozanoni
Copy link

Have same error on make -j 4 stage, i have installed swoole extension already

How did you install it? Via PECL or via source code? Via PECL seems to be incompatible with Swoole Async installation via source code.

@winslis2
Copy link

Make sure the two versions are consistent
and don't froget ./configure --with-php-config=..........
you can try try

@andrei-dascalu
Copy link

@winslis2 what do you mean by "make sure the two versions are consistent" ? Swoole has version 4.4.4 now but ext-async only goes to 4.4.3

@idekel
Copy link

idekel commented Aug 25, 2019

Hi everyone,
I have this error too. I tried to install both extensions from source and got this other:
error ext-async/swoole_async.cc:936:17: error: ‘struct swGlobal_t’ has no member named ‘main_reactor’ if (SwooleG.main_reactor != NULL)

@winslis2
Copy link

@winslis2 what do you mean by "make sure the two versions are consistent" ? Swoole has version 4.4.4 now but ext-async only goes to 4.4.3

swoole version 4.4.4 has coroutines model,ext-async is Outdated

@deminy
Copy link
Member

deminy commented Aug 26, 2019

For now Swoole extensions (including the async extension) are not tagged/released the same way as Swoole, thus it could be painful when using them with old versions of Swoole. Here is my suggestion to use or install the async extension (and other Swoole extensions):

  1. Use the official Swoole image. It has most Swoole extensions installed, although some of them not enabled by default.

  2. If you prefer to install a Swoole extension from source code, you may need to download the Git repository and switch to a Git commit first. You can find out which commit to use from the configuration files here. For example,

If you want to install with the latest code, please follow what @francescozanoni had suggested.

@andrei-dascalu
Copy link

@deminy thanks a lot!
Also, pretty nice that you maintain x64 and arm images per each php version

Cheers!

@deminy deminy closed this as completed Aug 30, 2019
@fakharak
Copy link

@winslis2 what do you mean by "make sure the two versions are consistent" ? Swoole has version 4.4.4 now but ext-async only goes to 4.4.3

swoole version 4.4.4 has coroutines model,ext-async is Outdated

I am using latest Swoole version 4.6.6. but this extension is confusing. My question is "can i make Asynchronous Client / Calls" in Swoole, without "ext-async" ? I mean is there an aleternate mechanism available ? to write Asynchrnous Client / Calls without "ext-async" ? OR, "ext-async" is one and only (mandatory) way in Swoole to write Asynchronous Client / Calls ?

@fakharak
Copy link

For some who have confusion about whether they should really use ext-async, or recommended swoole\coroutine\client for Swoole Asynchronous Clients / Calls.
#40

@winslis2 what do you mean by "make sure the two versions are consistent" ? Swoole has version 4.4.4 now but ext-async only goes to 4.4.3

swoole version 4.4.4 has coroutines model,ext-async is Outdated

I am using latest Swoole version 4.6.6. but this extension is confusing. My question is "can i make Asynchronous Client / Calls" in Swoole, without "ext-async" ? I mean is there an aleternate mechanism available ? to write Asynchrnous Client / Calls without "ext-async" ? OR, "ext-async" is one and only (mandatory) way in Swoole to write Asynchronous Client / Calls ?

#40

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests