I am having problem in running php in mac terminal. My scenario is I am using xampp which is actually shared from windows. Now I want to use cakephp bake commands in my mac terminal.How can I do this?
I have tried using export path="/volumes/xampp/bin:$PATH"
But I am unable to do it.
How can I change /usr/bin/php to /volumes/xampp/bin/php?
Related
Hello I am trying to execute this command:
export PATH="$HOME/.composer/vendor/bin:$PATH"
in windows.
Please, check these notes
Note: For the local PHP environment I am using a Mac and Valet because it automatically sets up everything. If you are on Windows, you should consider Homestead or some flavor of a virtual machine.
As the topic sentence says. I'm using atom with linter-php in ubuntu with an xampp setup. PHP is located in the opt/lampp/bin folder when you've installed xampp in ubuntu 16 but atom isn't accepting it. "unable to get version" and "spawn php ENOENT." Anyone out there using this same setup? Which path did you use for the php executable? Alternatively: Should i just install php in the standard file directory outside of xampp as well and direct linter there?
This may have been a bit of a hack approach to fixing this issue but i just installed php7.0 outside of xampp again and directed the linter path there. Actually didn't have to direct it at all. As soon as i installed php from the terminal, the issue was fixed.
I just installed Composer on OS X 10.8 and am now trying to use it to install something else and it turns out my terminal is running php 5.3... In XAMPP I have 5.5, so I would like to just use that version in Terminal as well. I tried creating a .bash_profile in my home directory with
export PATH=/Applications/XAMPP/xamppfiles/bin/php-5.5.11/bin:$PATH
but that wouldn't work; which php still returns /usr/bin/php. What am I missing here? Much thanks in advance.
Here is my working Environment Path
export PATH="/Applications/XAMPP/xamppfiles/bin:$HOME/.composer/vendor/bin:/usr/local/sbin:$PATH"
Remember to wrap the path with double quotes and also close all terminal before checking the php version using
php -v or which php
If you aren't using a bash shell, then changing the bash_profile won't make a difference. bash apparently wasn't always the default, so on my mac, I am using .tcsh. I don't know why it uses one over the other, it has just always been that way (been upgrading macs since OS X 10.0). So on mine I have a .tcshrc file which operates like the bash_profile. In there I have
alias php /Applications/MAMP/bin/php/php5.6.7/bin/php
which you would obviously have to adjust to your own path and version, but you get the point.
I just installed mamp (xampp) from the mamp.info page and it is working on my mac (both apache, php, phpmyadmin, and mysql). The only problem is when i try to run
mysql -u root -p
Which connects to mamp from the mac os terminal, i get a command error. I have installed and uninstalled mamp and xampp for mac multiple times to no avail.
I am following this tutorial; http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app and i can't get past a certain part because i don't want to use php admin, and i think it'd be cool to use it from the terminal.
My question; how do i configure mamp or xampp for mac to work from the terminal?
Put this at the end of your .bash_profile script (create it if it doesn't already exist):
export PATH=$PATH:/Applications/MAMP/Library/bin
I have CakePHP (cake_1.2.2.8120) and EasyPHP (3.0) installed on Windows Vista Ultimate. I followed the "baking" tutorials online and successfully set the database connection with the "cake bake" command from the CLI.
I baked the controller for my "Users" table using the "php cake.php bake controller Users" command - worked fine. However, when I tried baking the view similarly, I got this message:
Fatal error: Call to undefined function mysql_connect() in C:\Web\EasyPHP
\www\cake\cake\libs\model\datasources\dbo\dbo_mysql.php on line 374'
Also, the MySQL module is enabled for PHP on the phpMyAdmin page (web), but I can't find it in the CLI (using "php -m" from the command line) even though I've uncommented the "extension=php_mysql.dll" line in the php.ini file.
How can I fix this?
Grab XAMPP which has Apache with the MySQL and PHP modules setup and working together, as well at the MySQL and command-line versions. It just unzips to any directory, so it won't mess up any other Apache installs you have. Just be careful of any port conflicts between the different installations.
Download XAMPP
The root cause of the problem is that in EasyPHP 5.3 there isn't any php.ini file in the php folder.
Copy php.ini from EasyPHP5.3\apache to EasyPHP5.3\php to solve this nasty issue.
Copy the apache/php.ini file to php/php.ini.
I don't know EasyPHP, but it seems to be Apache-based. Check if you're using a Apache-module for the MySQL connection, as this will not work in CLI.