Archive
11月 2024
Showing 3 out of total 14
configure: error: in `/var/tmp/pear-build-rootw5cIJm/redis-6.0.2':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
the most esay way to install php redis is dnf/yum but it's not avaible for centos stream 9
so we use source code or pecl
pecl install redis
PHP Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/redis.so.so (/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading redis-6.0.2.tgz ...
Starting to download redis-6.0.2.tgz (365,966 bytes)
..........................................................................done: 365,966 bytes
43 source files, building
running: phpize
Configuring for:
PHP Api Version: 20220829
Zend Module Api No: 20220829
Zend Extension Api No: 420220829
enable igbinary serializer support? [no] :
enable lzf compression support? [no] :
enable zstd compression support? [no] :
enable msgpack serializer support? [no] :
enable lz4 compression? [no] :
use system liblz4? [yes] :
building in /var/tmp/pear-build-rootw5cIJm/redis-6.0.2
running: /var/tmp/redis/configure --with-php-config=/usr/bin/php-config --enable-redis-igbinary=no --enable-redis-lzf=no --enable-redis-zstd=no --enable-redis-msgpack=no --enable-redis-lz4=no --with-liblz4
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/var/tmp/pear-build-rootw5cIJm/redis-6.0.2':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
ERROR: `/var/tmp/redis/configure --with-php-config=/usr/bin/php-config --enable-redis-igbinary=no --enable-redis-lzf=no --enable-redis-zstd=no --enable-redis-msgpack=no --enable-redis-lz4=no --with-liblz4' failed
how to fix this
finally i got the answer ,
you should install
dnf install kernel-headers
yes, this site was developed by Yii3
if you want to develop multiple yii3 apps in the same folder,just like yii2 advance demo
we have a solution
the idea is filter the url accessed to the different app(instance) and load different config files
1. move the yii3 demo config files to a subfolder of config ,maybe frontend
if you want to add backend just copy frontend files to backend
if you need the app frontend and backend ,the config should includ 2 subfolders
config/frontend, config/backend
and modify the .merge-plan.php file in each app config folder
from
return [
'/' => [
to
return [
'/frontend (or othe app name)' => [
make sure it can load the right vender libs
2.modify the public/index.php to forward access to the different apps,
such as https://www.tianexcom/backend to load config/backend config files,
$request_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$_ENV['YII_ENV'] = '/frontend';
if (!empty($request_uri)) {
if (str_starts_with($request_uri, '/backend')) {
$_ENV['YII_ENV'] = '/backend';
}
}
to do this, you also need to mody the
vendor\yiisoft\yii-runner\src\ApplicationRunner.php protected function createDefaultConfig(): Config
{
return ConfigFactory::create(new ConfigPaths($this->rootPath, 'config'.$this->environment), $this->environment);
}