You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Debian 7.11 x64执行installer.sh提示“无法定位软件包php”求助

Fixing "unable to locate package php" on Debian 7.11 Wheezy x64

Hey there, let's work through this issue together—Debian 7.11 (Wheezy) is an older release that's reached end-of-life (EOL), so the default package sources are no longer active, which is almost certainly why you're hitting this error. Here's how to resolve it step by step:

Step 1: Replace outdated package sources

Since official support for Wheezy ended years ago, the standard repos are no longer hosted. We need to point your system to Debian's archive servers instead. First, back up your existing sources list to avoid breaking anything:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

Open the sources list with a text editor (nano is user-friendly for beginners):

sudo nano /etc/apt/sources.list

Replace all existing content with these lines to use the archive repository:

deb http://archive.debian.org/debian wheezy main contrib non-free
deb-src http://archive.debian.org/debian wheezy main contrib non-free

Save and exit nano by pressing Ctrl+O, hit Enter, then Ctrl+X.

Step 2: Fix GPG signature errors

When you update your package cache next, you'll probably get GPG errors because Wheezy's old signing keys aren't in your system by default. Import them with these commands:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 7638D0442B90D010

Step 3: Install the correct PHP package for Wheezy

Debian 7 doesn't have a generic php package—that's a convention introduced in newer Debian releases. Instead, the PHP 5 package is named php5. First refresh your package cache:

sudo apt-get update

Then install PHP 5 (add common extensions if your installer needs them):

sudo apt-get install php5 php5-cli php5-fpm

For example, if your script requires MySQL support, add php5-mysql to the command.

Step 4: Run your installer script again

Now that the package sources work and PHP is available (as php5), you can re-run ./installer.sh. If the script explicitly tries to install php instead of php5, you'll need to edit the script and replace all instances of php with php5 to match Wheezy's package naming.


内容的提问来源于stack exchange,提问作者benjamin nyqvist

火山引擎 最新活动