SSL Certificate on macOS

The output from these commands and when you start the shell would be helpful in debugging your WP-CLI installation and why wp search-replace doesn’t work.

Yes, same problem (SSL Certificate on macOS - #4 by Fra) when trying to wp search-replace, it still doesn’t work.

Here is the shell screenshot:

I don’t see any obvious problems. @Nick-B, what do you say?

The only thing I notice is that the WP_CLI phar path is missing.

WP_CLI phar path: /Users/<user_name>/Local Sites/<website_name>/app/public

Edit: I also noticed a missing row in the beginning when you start the site shell but maybe it’s just clipped in the screenshot?

/Users/<user_name>/Library/Application\ Support/Local/ssh-entry/07IG1cSU3.sh
Setting Local environment variables...

Can you send a full screenshot of your terminal when you try to run your search and replace?

Do you get errors when trying to run any other commands as well? For example if you just run wp plugin list or something like that do you get an error?

Hi everyone, sorry for my late reply!

Here is a full shell screenshot when trying to run wp search-replace and then wp plugin list.

I guess there must be something that is not working properly. What do you think?

@Fra

It looks like you are not in the correct directory for the Wordpress installation to be able to execute any wp command. Have you moved or renamed the Local Sites directory after the installation? Or have you changed the Sites path setting in the Local app? Take a look at your shell script file 07IG1cSU3.sh. I guess the cd <directory> is wrong or missing in the shell script.

/Users/<user_name>/Library/Application Support/Local/ssh-entry/07IG1cSU3.sh
cd "/Users/<user_name>/Local Sites/<website_name>/app/public"

No I din’t make any changes to those options. I’ve just tried to run a new test site and there’re the same problems. Now I can’t even trust the certificate and the shell I see the same things when trying to run wp ....


This always happens when I try to build a new site.

What I did, before building the site, is selecting a different folder to use as the Local sites one. But all the files seemed to be fine there.

I am a neophyte so this is very difficult for me to sort out.

Judging from your screenshot above, you are not in the WordPress directory and therefore all wp commands will fail.

Depending on where your newly renamed Local Sites folder is located it could also be a permission issue.

Please post answers and/or screenshots to the following questions so @Nick-B or someone else can help you out.

  1. What directory is the Sites path set to in the Local app Preferences panel? The directory path should be:
~/Local Sites/
/Users/<user_name>/Local Sites/

  1. Where is the WordPress installation located for the site in question? The directory path should be:
/Users/<user_name>/Local Sites/<website_name>/app/public/

  1. What’s the path to the site folder that opens when you press the Site folder button in the Local app? The path should be:
/Users/<user_name>/Local Sites/<website_name>/

  1. Find and open the shell script file for the site in question (07IG1cSU3.sh in your screenshot above). The file path is:
/Users/<user_name>/Library/Application Support/Local/ssh-entry/07IG1cSU3.sh

  1. What does it say after the cd command in the end of the shell script? The cd directory path should be:
cd "/Users/<user_name>/Local Sites/<website_name>/app/public"

1 Like

Thank you for the help here @emmtre!

There is definitely some great information worth checking through above there @Fra from Emmtre, but if you’re still struggling you might try the reset steps I outlined here. If something has been moved or shifted and is no longer syncing up, then that may correct the behavior again for you.

2 Likes

Thank you @emmtre and @Nick-B! Sorry for my late reply!

Here are all the screenshot you asked me, I hope this can help sort the problem out. In the meantime I also tried to create a new site from scratch but it shows the same exact problem.

When I installed local, I changed Preferences>New site defaults>Site path and I chose a different folder in order for all the sites to be in an iCloud Drive folder. I don’t know if this may be what caused the problem.

Hi @Fra - I think the New Site Defaults might be part of the issue. Could you try my uninstall/reinstall steps I provided above but when you bring Local back just leave the New Site Defaults to where it originally starts up and see if that works?

Hi @Nick-B, thanks, I’ll try that, even though the reason I did that is because I wanted all the files in my iCloud in case my Mac had any problem. Let’s see if in this way it works as it should.

Ok, I’ve followed all your steps. I’ve just tried to create a new site from scratch to try, but now I can’t trust the SSL (https://localwp.com/help-docs/getting-started/managing-local-sites-ssl-certificate-in-macos/) because Step 1 doesn’t seem to work at all. It shows the red bar in the upper part, as in the image I sent, but it still creates the certificate in the Keychain Access, which I modified in “always trust”. Then I stopped the site, closed Local, reopened it and started the site again. Then I went back clicking on the “trust” button on Local but it keeps showing the red bar. When opening the site via WP Admin, though, there is the https:// so I don’t know what is the problem now.

I tried this way. Opened the shell and run the WP search-replace command, here is the picture. The SSL went automatically on trusted, but as it happened before, when trying to open the site via the Open site button on Local, there is again no SSL or certificate within it.

It doesn’t look like your picture came through @Fra

But your Site Shell and commands are working normally now?

Aside from the SSL issue are you otherwise able to access your site in the front and back end?

Have you tried any other other SSL troubleshooting tips in the help article above?

Hi @Nick-B! I’ll try to upload the pictures again. The Site Shell seems to work normally for I am able to understand. I am also able to access the site both in the front and back end, despite of the SSL issue. And I tried everything I found, but the problem now is just the Open Site button not opening the site with SSL. I don’t understand why all this happened just by changing the New site folder. Now I need to have all the files saved on my Mac HD instead of iCloud Drive, but I could use the plugin to do backups on Google Drive.

Here are the picture of the WP search-replace command:

Okay so it sounds like all of your issues are resolved now but the only thing outstanding is that your Open Site opens insecurely. Is that correct?

Which brings us back to this bug that Emmtre mentioned earlier. If your certificate is trusted and your S/R is done and caches are flushed, then you might just be experiencing the bug.

1 Like

Thank you both! I decided to leave it as it is, since being developed locally there’s no actual need for SSL.

It would be nice to be notified, if possible naturally, when this issue is solved.

Thanks again for your help!

1 Like

If you vote or comment on that Bug above @Fra you’ll get notified there when we resolve it and close it!