When you use wget with -b option the command create a subprocess in other shell session (setsid). The original process finishes after the subprocess was launched.
The subprocess runs in other shell session so we can't use wait command. But we can write one loop that check if subprocess is running. We need subprocess's pid.
By example:
wget -b http://example.com && \
(
PID=`pidof wget | rev | cut -f1 | rev`;
while kill -0 $PID 2> /dev/null; do sleep 1; done;
) && \
php script.php &
Another way to get the pid of the subprocess could be parse the output of wget.
Aditionally, for understand how work background option of wget you can see the source code in C:
...
pid = fork ();
if (pid < 0)
{
perror ("fork");
exit (1);
}
else if (pid != 0)
{
printf (_("Continuing in background, pid %d.
"), (int)pid);
if (logfile_changed)
printf (_("Output will be written to `%s'.
"), opt.lfilename);
exit (0);
}
setsid ();
freopen ("/dev/null", "r", stdin);
freopen ("/dev/null", "w", stdout);
freopen ("/dev/null", "w", stderr);
...