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 trialArian Popalyar
4,962 PointsPHP console
Hi I want to run the php require commad to use swif maile etc can you please tell me how to access the console in Windows and Mac.
In the videos i have seen the work space console but i don't in Windows and Mac how to access it. I have installed XAMP and i have php admin as well normal php files local host all work on just confused by the php console (coz i don't think its browser console)
6 Answers
Arian Popalyar
4,962 PointsTo download the composer in MAC go to your Application then open "Utilities" folder then then click on Terminal.app and there you can type code to download the composer which is below: curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
Ted Sumner
Courses Plus Student 17,967 PointsIf I understand your question correctly, you are asking two unrelated things. First, the command prompt in windows is located in the start menu. Select start, then type cmd into the search box and hit enter. It will start the command line.
You state that you want to require your site to use SwiftMailer. That is not done in the system command line. The best way to do it is to install composer, initialize it for your site, then use that to install SwiftMailer. This course teaches you how to do those things, but you should have a strong basis in PHP prior to taking the course because it does not cover the basics. http://teamtreehouse.com/library/building-websites-with-php
Arian Popalyar
4,962 Pointsthanks, i still have one more confusion, so for my local host i will install the composer but then how i will use the swift mail in the website live my live site hosted site?
Ted Sumner
Courses Plus Student 17,967 PointsYou really need to take the course. It will walk you through the installation of what you need, how to use it, and (if I remember right) configure SwiftMail. It may be PHPMail. One is in this course, the other is in the build a web app course.
Ted Sumner
Courses Plus Student 17,967 PointsThe short answer (from memory, so I am not positive) is that you need to install Composer on your computer. Then you initialize composer for the project from the command line. Once that has happened, you use composer to install your mailer. Then in your PHP file you have to enter the correct lines at the beginning of your file in the right order. But the course also uses a framework called Slim and a templating program called Twig. Both are very cool, but you REALLY need a good background in PHP to understand what is happening and so you can troubleshoot it.
Arian Popalyar
4,962 PointsThanks Ted