Local web server

I installed a new app (3.9) with composer.
But when I run “bin/cake server”
terminal says “bin/cake: command not found”

Any idea ?

1 Like

Windows or Linux?
In Windows the directories are separated by a backslash, so it’ll be bin\cake server.

This may sound like a dumb question, but make sure your actual terminal is in the correct folder. If you do dir or ls do you see the bin folder? Make sure the files cake, cake.php & cake.bat are there. Make sure you have the php interpreter working on the command-line - as all the bash cake / Windows batch file does is call the cake.php.

Thank you for taking time to answer.
I am on Mac OS with MAMP.
The install was made with composer and all files are in the right place, especially the bin folder and its files.
I am trying to get rid of MAMP because recent versions do not include INTL extension and you can no longer install cakephp.
That is why I would like to use the built in server.

I’m sorry to say I am clueless with Macs - hopefully someone else here can come to the rescue!

Hi @6120, make sure you are running the command from the root of the directory in CakePHP project. If you are still having issues please show us some screenshot along with directory structure from you are currently running command.

I would advise using a regular server, apache or nginx and not the php built in server. Just my opinion.

Thank you all for taking care of my problem.

My problem is or will be the problem of many Mac users.
Until now and since [ I don’t remember when ], I used MAMP as local server. It has always worked perfectly.
But mamp does not include the INTL extension and it is almost impossible to install intl in mamp.
Then I tried xampp but it’s the same issue.

So there is only one solution left, it is installing an Apache server with all the right tools.
I do not know how to do this. My knowings are limited to php and js.

This is why I wanted to try the built in development server.
If any of you ears about something I never heard about, he is welcome.

Thank you again

I know I won’t be hearing anything but if you’re doing this professionally (thus prepared to spend money) and you don’t have a webpage of which you have TTY access, you may look into something like a DigitalOcean Droplet at $5 a month.

If you do have a webpage create a sub-domain for yourself for testing, and use the .htaccess to lock it to your IP only, and 403 everyone else. Same thing for a droplet. Then whatever IDE you’re using have it automatically upload any file changes. If you’ve set your htaccess correctly so only your dev machine can see it (test via your phone on its data plan) then you’re safe to enable debug etc on server.

Thank you Jawfin.

This is what I am doing since I can’t work with a local server.
The problem is with IDEs.
It seems none have this feature built in. Of course you can do this with most of them, but at the cost of such a waste of time.
None of them include a real FTP browser and this is what I need.
Because I have many clients on many servers and I often have to switch from one server to another.

There was a brilliant one, Coda, from Panic software but it is no longer maintained and their new one (Nova) is such a disappointment.
I tried Sublime Text but is is really meant for local work.
I downloaded Atom and am going to give it a try.
And this old BBedit too.

Thank you all. It’s night here and I going to sleep.

PHPStorm has support for direct deployment when you save your files. I’m actually running it on my Linux dev server, connecting to an X server running on my Windows laptop, so I don’t use that part, but I’ve definitely seen it documented.

Thank you.
I will try this one too.

bin/cake server
Your entered command is true but checks that you are not inside the bin directory
image
you can check here is my Screenshot

hey @6120,
you should need to check first not inside the bin directory, you can check here my screenshot
image

Thank you hala0409.
How can you run 4.1 in camp ?
Does it include intl ?

Hey @6120,
Sorry but I do not understand what are you actually say.
No “intl” does not include in the server or cakephp project its include in your XAMPP, WAMP, or MAMPP and if it does not include then you need to install it manually
I am pasting here a URL I think its help you to manually install :
How to Enable INTL PHP Extension for MAMP on OSX 10.9.2 - Page Wood - Page Wood (pagegwood.com)

Thank you hala0409.
Intl is not included in MAMP and you can’t install cakephp 4.X (not even 3.4 +) if intl is not present.
I tried several tutos but either they were too old (php < 7) or they just did not work.
This one is for Mac OS 10.9 and I run 11.x
Thank you again.

Hey @6120,
Have you tried an old PHP INTL extension installation method and also trying xampp in mac I think it should be given by the prebuilt extension inside it.

Thank you again.

I will have a look at this when back to work next Monday.