What are the key considerations when starting to create a social networking website like Facebook using PHP?

Key considerations when starting to create a social networking website like Facebook using PHP include designing a user-friendly interface, implementing secure user authentication and authorization systems, optimizing database queries for scalability, and incorporating features such as messaging, notifications, and photo/video uploading.

// Example PHP code snippet for user authentication using sessions
session_start();

// Check if user is logged in
if(isset($_SESSION['user_id'])) {
    // User is logged in, perform actions
} else {
    // Redirect to login page
    header("Location: login.php");
    exit();
}