Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP The php.ini File

Sean Flanagan
Sean Flanagan
33,235 Points

Using the terminal

Hi.

Sorry to have to start two threads on the same video but I'm stuck again.

I've watched 2 minutes of this video. When I typed sudo vi in the terminal, I got a message:

sudo is not recognised as an internal or external command, operable program or batch file.

I'd appreciate any help please.

7 Answers

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

On windows, notepad is probably the easiest. You can open notepad first then choose File > Open or copy the path and open a terminal window, example

notepad C:\MAMP\conf\php7.0\php.ini
Sean Flanagan
Sean Flanagan
33,235 Points

Hi Alena.

Thanks for your response.

I got as far down the path as conf but when I typed cd php7.0 the system couldn't find the path.

Vis-a-vis Notepad++, I've opened index.php and it says "Test" as of when I last used it.

Alena Holligan
Alena Holligan
Treehouse Teacher

Step 1: While your server is running, go to the phpinfo file in a browser I'm using http://localhost/phpinfo.php

Step 2: Search for β€œphp.ini”. You should see something like β€œConfiguration File (php.ini) Path”. Examples: C:\MAMP\conf\php7.0

It seems that you are using Windows. The Windows command prompt isn't the same as *nix and Mac systems' command prompts, and its commands are quite different.

Sean Flanagan
Sean Flanagan
33,235 Points

Hi Alexander. Thanks for your help.

What should I do then, please?

Cheers

Sean Flanagan
Sean Flanagan
33,235 Points

"Loaded configuration file: C:\MAMP\conf\php7.2.1\php.ini" Is that it?

Sean Flanagan
Sean Flanagan
33,235 Points

Got it. Thank you. My servers are running but I have a white screen saying the localhost page can't be found.

Alena Holligan
Alena Holligan
Treehouse Teacher

try adding the port? so http://localhost:8888

Or try from MAMP "Open WebStart page"

Sean Flanagan
Sean Flanagan
33,235 Points

Hi Alena.

Apologies for previous delays. Unfortunately I suffered an asthma attack last week so the last few days have been very stressful for me and this problem has had to take a back seat, so I appreciate your patience throughout this difficult time.

Right, I've clicked the link to the port and I got a white screen with the text "Test Website 2". How am I doing so far?

Alena Holligan
Alena Holligan
Treehouse Teacher

Sounds like it's working, as long as Test Website 2 is what you expected? If not you may need to go into Preference > Web Server and check that the Document Root is pointed to the correct folder

Alena Holligan
Alena Holligan
Treehouse Teacher

you should be good then, I just wanted to make sure you were getting what you expected. You could be showing something else if the folder wasn't linked properly