cancel
Showing results for 
Search instead for 
Did you mean: 

Installing Magento on Mac does not show sample site on localhost

Installing Magento on Mac does not show sample site on localhost

Hello all 

 

I am struggling with the installation of Magento 2 on a macbook pro (macOS Monterey 12.3.1).

I installed MAMP (works fine - no error in the logs when starting the server); the sql database gets populated by magento installation  (for instance, I can see the baseurl in "core_config_data").

When accessing the baseurl ("http://localhost/magento2/"), nothing is shown in chrome or safari - "the requested url was not found on this server".

I have tried tons of suggested fixes, but none has worked for me.

 

Please let me know what more information you need to get a clearer picture what's happening on my end.

3 REPLIES 3

Re: Installing Magento on Mac does not show sample site on localhost

LE: Playing around with the .htaccess (in magento2 folder) i get the following:

Screenshot 2022-05-06 at 12.53.38.pngDiving further into the directories:

Screenshot 2022-05-06 at 12.56.10.png

Let mw know what else shall I try.

Thanks!

Re: Installing Magento on Mac does not show sample site on localhost

It sounds like there might be an issue with your Magento installation or server configuration. Let's go through some steps to troubleshoot and resolve the issue:

  1. Check Web Server Configuration:

    • Make sure your Apache or Nginx server is properly configured to serve Magento files. Check the virtual host configuration, and ensure that the document root points to the Magento installation directory.
  2. Check File Permissions:

    • Ensure that the file and directory permissions are set correctly. Magento requires specific permissions for different directories. You can refer to the official Magento documentation for the recommended file permissions.
  3. Check .htaccess file:

    • Ensure that the .htaccess file in the Magento root directory is present and configured correctly. This file contains important settings for URL rewriting.
  4. Clear Cache:

    • Clear Magento cache and the cache of your web browser. Magento caches configurations, and sometimes changes may not take effect until the cache is cleared.
  5. Check Logs:

    • Check the Magento logs for any error messages. You can find logs in the var/log directory within your Magento installation.
  6. Check Rewrite Module:

    • Make sure that the Apache rewrite module is enabled. You can check this in your Apache configuration.
  7. Update Base URLs:

    • Check the database directly to ensure that the base URLs are set correctly. You can run the following SQL query to verify:
SELECT * FROM core_config_data WHERE path LIKE '%base_url%';
    • Make sure that the web/unsecure/base_url and web/secure/base_url values are set to the correct URL.
  1. Verify Magento Installation:

    • Check if the Magento files are correctly installed in the specified directory. Ensure that there are no missing or corrupted files.
  2. Check PHP Version:

    • Ensure that you are using a supported version of PHP. Magento 2 has specific PHP version requirements.
  3. Check MAMP Configuration:

    • Double-check the MAMP configuration to ensure that it is serving the correct directory and using the correct PHP version.
  4. Browser Console:

    • Open your browser's developer console (usually by pressing F12 or right-clicking and selecting "Inspect," then going to the "Console" tab) to check for any JavaScript errors that might be preventing the page from loading.
  5. Check Apache Error Log:

    • Check the Apache error log for any error messages related to your Magento installation. The Apache error log is usually located in the /var/log/apache2/ directory.

By going through these steps, you should be able to identify and resolve the issue causing Magento not to display the sample site on localhost. If the problem persists, please provide any relevant error messages or log entries for further assistance.

 

Re: Installing Magento on Mac does not show sample site on localhost

Tried all the steps mention but still not working it is looks like admin panel is keeps loading for a while - it only showing the loadings

here is my mac book pro nginx configuration file 


server {

    listen 80;

    server_name dev.local.co.nz;



    root /usr/local/var/www/local/pub;

    index index.php index.html;



    location / {

        try_files $uri $uri/ /index.php?$args;

        autoindex on;

    }



     # Handle requests to media files

    location /media/ {

        try_files $uri $uri/ =404;

    }



    # Handle requests to the pub directory

    location /pub/ {

        try_files $uri $uri/ =404;

    }



location /static/ {

    if (!-f $request_filename) {

         rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;

    }

}



    location ~ \.php$ {

        include fastcgi_params;

        fastcgi_pass localhost:9000;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    }

   location ~ /\.ht {

        deny all;

    }

}

please let me know what need to be done 

permission and .ht file are good