我正在尝试安装此文件 .shhttps://github.com/greatfire/website-mirror-by-proxy/tree/master/install 我使用了这些命令行
chmod +x install.sh
sudo ./install.sh
之后它向我展示了那些线
Building dependency tree
Reading state information... Done
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php5' has no installation candidate
Installing HTTP extension
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libcurl4-openssl-dev' instead of 'libcurl3-openssl-dev'
Package php5-mcrypt is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Unable to locate package php5-dev
E: Package 'php5-mcrypt' has no installation candidate
./install.sh: line 3: pecl: command not found
tee: /etc/php5/mods-available/raphf.ini: No such file or directory
extension=raphf.so
./install.sh: line 5: php5enmod: command not found
./install.sh: line 3: pecl: command not found
tee: /etc/php5/mods-available/propro.ini: No such file or directory
extension=propro.so
./install.sh: line 5: php5enmod: command not found
./install.sh: line 3: pecl: command not found
tee: /etc/php5/mods-available/http.ini: No such file or directory
extension=http.so
./install.sh: line 5: php5enmod: command not found
Enabling Apache modules
Module rewrite already enabled
我尝试安装 php5,但我有 php7!有什么方法可以安装这个文件吗?
我在这里更新:
我制作了一些版本以使其与 v20.04 (php 7.4) 兼容
#!/bin/bash
function pecl_install {
pecl install $1
echo "extension=$2.so" | sudo tee /etc/php/7.4/mods-available/$2.ini
echo "; priority=$3" | sudo tee -a /etc/php/7.4/mods-available/$2.ini
php7enmod $2
}
if [ $(/usr/bin/id -u) -ne 0 ]; then
echo "Not running as root"
exit
fi
echo "Installing Apache and PHP"
apt-get install apache2 php7.4 php7.4-curl
echo "Installing HTTP extension"
apt-get install libpcre3-dev libcurl3-openssl-dev php7.4-dev php-http php7.4-mcrypt>
pecl_install pecl/raphf raphf 20
pecl_install pecl/propro propro 20
pecl_install pecl_http http 30
echo "Enabling Apache modules"
a2enmod proxy
a2enmod proxy_http
a2enmod rewrite
但是我对第 18 行仍有疑问,这一行:
apt-get install libpcre3-dev libcurl3-openssl-dev php7.4-dev php-http php7.4-mcrypt>
那么,这里有任何解决方案吗?能够安装“TTP 扩展”!!