import subprocess import sys def main(): try: subprocess.run( ["php", "-S", "localhost:3001"], check=True ) except KeyboardInterrupt: print("\nServer stopped.") sys.exit(0) if __name__ == "__main__": main()