Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lebod's avatar

Updating Forge\Ubuntu w. ppa:ondrej/php

When doing apt-get update I get the error:

W: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found

Doing research, it seems that you need to move to /ondrej/php instead ? After doing

add-apt-repository ppa:ondrej/php

apt-get update

apt-get upgrade the system upgrade php from 7.0.35 to 7.0.41 and upgrades a few other files

It completely screws up our app though. We get the error :

Fatal error: Uncaught ReflectionException: Class log does not exist in /home/forge/.com/bootstrap/cache/compiled.php:1286 Stack trace: #0 /home/forge/.com/bootstrap/cache/compiled.php(1286): ReflectionClass->__construct('log') #1 /home/forge/.com/bootstrap/cache/compiled.php(1237): Illuminate\Container\Container->build('log', Array) #2 /home/forge/.com/bootstrap/cache/compiled.php(1775): Illuminate\Container\Container->make('log', Array) #3 /home/forge/.com/bootstrap/cache/compiled.php(1329): Illuminate\Foundation\Application->make('log') #4 /home/forge/.com/bootstrap/cache/compiled.php(1313): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 /home/forge/.com/bootstrap/cache/compiled.php(1299): Illuminate\Container\Container->getDependencies(Array, Array) #6 /home/forge/.com/bootstrap/cache/compiled.php(1237): Illuminate\Container\Container->build('\Exceptions\H...', Array) #7 /home/forge/ in /home/forge/****.com/bootstrap/cache/compiled.php on line 1286

Would you guys have any idea why this is happening ?

0 likes
6 replies
ifpingram's avatar

@Lebod I've had a similar problem and it turned out that the upgrade did not install the php mbstring extension. I fixed it with:

apt-get install php7.0-mbstring
spar_x's avatar

I did the

add-apt-repository ppa:ondrej/php

But after doing sudo apt-get update I still keep getting the errors

W: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found

Even after running

sudo add-apt-repository --remove ondrej/php-7.0

I still get the same errors.. what gives?? apt-get-update cannot complete while these errors are present. How do I get rid of them?

yajra's avatar

Just ran into the same issue of @vesper8 when recreating my homestead box and code below fixes it for me. Sharing in case this might work for you guys.

sudo rm /etc/apt/sources.list.d/ondrej-php-*
sudo add-apt-repository ppa:ondrej/php
6 likes
yajra's avatar

@davidlapham, first command manually removes the deprecated repo of php7-0 which are causing the 404 issue. Second command adds the new PPA repository. ^_^

1 like
spar_x's avatar

For anyone this might help, this is the full list of commands needed to do a proper update to php7 on laravel forge running Ubuntu 14.04

sudo rm /etc/apt/sources.list.d/ondrej-php-*
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/php-qa

sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install libapache2-mod-php7.0 php7.0-fpm php7.0-common php7.0-cli php-pear php7.0-curl php7.0-gd php7.0-gmp php7.0-intl php7.0-imap php7.0-json php7.0-ldap php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-ps php7.0-readline php7.0-tidy php7.0-xmlrpc php7.0-xsl
sudo apt-get --purge autoremove
5 likes

Please or to participate in this conversation.