<?php
$homepage = "/";
$currentpage = $_SERVER['REQUEST_URI'];
if($homepage!=$currentpage) {
echo'
<script src="popup.js"></script>';
}
?>
Try this, then. If it doesn't work, do a test and see if something other than / is the output for $currentpage then change $homepage = "/"; to the homepage value. That way you don't need another php file.

__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.

I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..