On my sever i successfully install phalcon version 0.6.0 through git. These are the steps i used.
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
restart the webserver
I tried to update to version 0.7.0, so i deleted the original folder and re-downloaded the git folder. I followed the same steps, after the install i check phpinfo. It installed correctly but, it installed a previous version(0.5.2).
I tried to install the extension multiple times but, it still gives me the old version.
is there something im doing wrong, any help would be appreciated.
Find if you have any phalcon.so files laying around and they are used instead of the actual one. It could very well be that the 0.5.2 is somewhere in your system, referenced by your web server and the installation process cannot update it.
locate phalcon.so
Note: for my installation it was in /usr/lib/php5/20100525/phalcon.so
Check your php.ini or your /etc/php/conf.d folder for references to the extension. If there are some remove them.
Re-run the installation process again using the
cd build
sudo ./install
Note the script output, especially at the end. It will tell you where the extension was installed.
Note the folder and add the directive in the php.ini file and then restart your web server for the changes to take effect.
It seems that you have installed PHP 5.3 on CLI but PHP 5.4 on Apache/Nginx, make sure your 'phpize' command is pointing to the 5.4 one:
[#] whereis phpize
Once you know the correct path change the priority of the executable, delete the PHP 5.3 or add an alias in the bash console:
[#] alias phpize=/path/to/5.4/phpize
Then try to run ./install again
Related
As the title says im trying to install a php extension (zip.so) that is missing from php7.1 version in ampps 3.8. I have searched for an answer but no luck so far.
Also using php5.6 and going to the php extensions list im able to see the zip extension, but since the software that im trying to intstall requires php 7.X im unable to simply use php5.6.
Thanks for the help in advance.
I finally found a way to do it:
Go to (for example) https://pecl.php.net/ and download the extension that you need.
Unzip the extension and go to the file location $ cd my/extension
Run phpize /usr/local/ampps/php-7.1/bin/phpize
Next run ./configure --with-php-config=/path/to/my/php-config for example ./configure --with-php-config=/usr/local/ampps/php-7.1/bin/php-config
make and sudo make install
In the end of sudo make install log you will find this Installing shared extensions: /usr/local/ampps/php-7.1/lib/extensions/no-debug-non-zts-20160303/ file path.
Go to the file path and you will find your compiled extension, for me it was zip.so
Finally copy the extension into your php folder /usr/local/ampps/php-7.1/lib/extensions/ext and you will be able to see it on the list of extensions in ampps, dont forget to enable it and restart apache2!
Hope it helps!
There is an easier way to do so
Open AMPPS Application ->Stop Apache (If running)
2 In "PHP" Tab -> "PHP Extension"
Enable "zip.so".
Apply
Restart Apache.
See image for clarification I am using a mac
I created a new project with Laravel, then I put it in the corresponding path for apache could execute, then I write the URL in a browser to open the project and I get the following message
Mcrypt PHP extension required.
I installed mcrypt with this command
brew install homebrew/php/php55-mcrypt
and work fine when I create a new project in laravel
I was searching and I found this tutorial but still withouth work
Open /etc/php.ini and add the line below at the end extension=mcrypt.so.
If there is no php.ini file, then you need to make one from php.ini.default in the same location like so: sudo cp /etc/php.ini.default /etc/php.ini
allow write capability sudo chmod u+w /etc/php.ini
Then add the line as above in your favourite text editor: sudo nano /etc/php.ini
add in the line: extension=mcrypt.so
Restart Apache sudo apachectl restart
but still without work, what can I do?
While it's always good to do PHP stuff on a local server, you will almost always run into the issue of getting everything set up correctly if you don't know what you're doing. My advice, use a service already provided for you.
Using Homestead (Laravel's Dev Environment) will help in getting projects setup very quickly. It'll also have all the PHP modules (e.g. mcrypt) already configured.
I'd take a look at Homestead: Laravel Homestead
Try visiting: Install mcrypt for php on Mac OSX 10.10 Yosemite
OR
Just see your phpinfo(); it will give you the status for mcrypt.
OR
Try updating your php version. Visit: Update PHP
See, if that helps you.
I am trying to enable XSL on Ubuntu 12.04 but its failing. I did this locally on my Ubuntu 13.04 and it was successful. Basically the following worked on my local computer.
apt-get install php5_xsl
edit php.ini file and add extension=php5_xsl.so
restart apache
I repeated the same procedures on my production server running Ubuntu 12.04 and PHP version 5.5.12 but the extension is not getting loaded from the phpinfo. I have also changed the extension=php5_xsl.so to extension=xsl.so because this is what in the extension directory.
I read that I might need to recompile PHP but I am not sure of this steps.
Try this:
sudo apt-get install php5-xsl
sudo php5enmod xsl
sudo service apache2 restart
Why:
http://www.lornajane.net/posts/2012/managing-php-5-4-extensions-on-ubuntu
What's happened here is that all debian-flavoured unixes have adopted
this standard for their PHP 5.4 packages, so if you're using debian,
ubuntu, or any of their relatives with PHP 5.4, you'll see a directory
structure like this. When you add a module to PHP, you'll add a file
to the mods-available directory enabling the module and adding any
config specific to it. If you want to enable the module, just do:
php5enmod http
This simply creates a symlink from the usual conf.d directory to point
to where the real files are in mods-available, prefixed with a number
that indicates the priority of the module. By default, the priority is
20.
Using this approach means we can toggle things on and off without
commenting out big chunks of config files and leaving them lying
around - if this seems familiar then that's no surprise; debian-like
linuxes manage their apache configuration in just the same way. Any
packages that you install using aptitude will use these exact same
commands to set up the configuration and then symlink it correctly. To
unlink, use the delightfully predictably-named php5dismod :)
After I tried for hours to find the good path for PHP-CLI, i finally found it. But my proud was soon gone again.
Still i got the following error:
The following requirements were not met. As a result video uploads have been disabled.
Unable to locate path to PHP-CLI
I have tried much different paths
bin/php
usr/local/lib
usr/local/lib/php
usr/local/bin/php (this is the good one I thought).
Still getting the same error as above. Whats happening? My server is not running in Safe Mode and my exec() are enabled via the php.ini file.
Please help me..
Edit:
Paul
Q: Have you tried any "fully qualified paths", e.g. "/bin/php" (not
just "bin/php")?
A: I have tried both solutions, no result.
Q: Are you sure php-cli is installed on your system (it's typically a
seperate package from the Apache PHP plug-in)? EXAMPLE: apt-get
install php5-common libapache2-mod-php5 php5-cli.
A: I tried this in the SSH of my server, its a CentOS server so he didn't found the comment
#Peter:
If you installed PHP through your OS package manager, the path would
probably be /usr/bin/php, which appears to be the only one you didn't
try
I tried that one now, i didn't help, still the same error:
Edit2
#Dev-null
You have found and what? Just knowing where >is located will not fix it, have you changed some >code or environment variable PATH to make it
A: its an input field where i need to put the path in. I haven't changed any code, because PHP version 5.3.17 (CLI) installed on my CentOS server. So no need to change some code just for the path, right?
Edit
My PHP info, PHP 5.3.17 (CLI) Check the image below..
Edit
When I do rpm -q php-cli I get PHP-CLI not installed and when I want to install i get No package php-cli available. See image below.
Edit
Result of /bin/php -v below.
CentOS ships the PHP command-line interpreter in the php-cli package. So you first need to verify whether it's installed or not:
rpm -q php-cli
If installed, you can list all its files:
rpm -ql php-cli
... and filter out potential binaries:
rpm -ql php-cli | grep /bin/
You can get further details in the Using RPM chapter of the deployment guide.
If the package is not installed:
yum install php-cli
More info at Installing New Software with yum.
All this answer assumes that nobody broke the package system by installing software manually. If that happened, there's no way to tell what changes were made to the system.
Edit #1: I've just seen your last edit where php-cli is up and running. Then, if you want to know the path you just need to type this:
which php
Edit #2: You seem to have up to 4 binaries called php in your path. I still think that the proper reliable way to find the php-cli binary is running rpm -ql php-cli but given that php finds it on the path I'm pretty sure that it's located at /bin/php and you can verify it by running:
/bin/php -v
Run that exact command—don't remove any slashes or append -cli.
If your script, whatever it looks like, cannot find it, it's either doing it wrong or it's missing the appropriate permissions.
try the following to find it:
sudo find / -name php-cli
You most likely want php instead of php-cli though.
None of the solutions on this page found the installed versions of PHP that were present in my own elusive search for php-cli. The solution for me was to use the following command:
locate bin/php
This listed all php versions and I could then replace php with, for example:
/usr/bin/php71-cli
To access the command line interface version of php rather than the default cgi one. I then alias my instructions like so:
alias composer='/usr/bin/php71-cli bin/composer.phar'
I installed "drush" for my drupal website.
when I tried to run "drush":
[root#server /]# drush
/usr/share/drush/drush.launcher: line 132: /usr/bin/php-cli: No such file or directory
[root#server /]#
php-cli was not in my default directory /usr/bin
Solution was to copy my "php"-file to "php-cli" file (no rename!!, just copy)
[root#server /]# cp php php-cli
weird, but still working!
I am using MAMP and would like to use mongo with PHP. I am stuck because the version of MAMP I'm using is the latest version I can find, and it's running PHP 5.2.11. The only Mongo PHP install I can find for OSX is for PHP 5.3.
Is there any way to get mongo working with PHP using MAMP?
For MAMP 2.1.2 and PHP 5.4.10
Download MongoDB php driver .
copy mongo.so to
/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/
and using temrinal
cd /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/ && wget https://github.com/downloads/stennie/mongo-php-driver/mongo.so
open
/Applications/MAMP/bin/php/php5.4.10/conf/php.ini
Find ; Extensions
add
extension=mongo.so
Restart MAMP.
Above steps will install MongoDB driver 1.2.10.
To install latest Mongodb driver using PECL
install autoconf using homebrew or Mac Ports
brew install autoconf
Download php 5.4.10 source from php.net.
rename uncompressed php source folder from php-5.4.10 to php and paste it in this folder
/Applications/MAMP/bin/php/php5.4.10/include/
using the terminal open php folder and run ./configure
cd /Applications/MAMP/bin/php/php5.4.10/include/php/ && ./configure
Add MAMP bin to your ~/.bash_profile
echo "export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH" >> ~/.bash_profile
source ~/.bash_profile
install latest mongo
pecl install mongo
restart MAMP server :).
Here's a tutorial how to do it: http://www.davidgolding.net/mongodb/installing-mongodb-on-mamp-1-9-5.html
Post was removed so here's the tutorial:
Appsolute launched MAMP version 1.9.5 today, so I thought it’d be a great time to add MongoDB to it and improve my NoSQL skills.
Prepare MAMP for MongoDB files
Create a new folder at Applications/MAMP/db/mongo with three additional subfolders named bin, data, and tmp. Provide these folders with chmod 0755 access permissions. These folders will be the main runtime location for Mongo once MAMP gets it running.
Download MongoDB
Grab the latest Mac OS install package of MongoDB. My server setup called for OS X 64-bit, version 1.6.5. It’ll have a directory named bin. Drop the files from this folder into the /Applications/MAMP/db/mongo/bin folder you already created.
Download Mongo Driver for PHP
I’m running PHP 5.3 (why use MongoDB with any earlier version of PHP?), so I’ll need the mongo.so extension to get PHP and Mongo working together. This is available at the MongoDB GitHub repository, under the PHP 5.3 for Mac binary. After unpacking the downloaded file, place the mongo.so extension file in the /Applications/MAMP/bin/php5.3/lib/php/extensions folder.
Update: An alternative is to place the mongo.so file in the /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626 folder and avoid having to edit the php.ini file. It appears that MAMP 1.9.5 already has the extension=mongo.so line in the extensions block of the php.ini file, even though version 1.9.5 doesn’t come bundled with Mongo.
4. Create Startup Routines for MAMP
Lastly, you’ll need to create the startup routines so that MAMP will launch Mongo along with MySQL and Apache. Create a new file at /Applications/MAMP/bin/startMongo.sh and place in it the following code:
# /bin/sh
/Applications/MAMP/db/mongo/bin/mongod --dbpath /Applications/MAMP/db/mongo/data --logpath /Applications/MAMP/db/mongo/mongodb.log --pidfilepath /Applications/MAMP/db/mongo/tmp/mongo.pid --fork --logappend
When called, this script will launch Mongo using the MAMP-relative paths rather than Mongo’s system defaults.
Create another file at /Applications/MAMP/bin/stopMongo.sh and place the shutdown method:
# /bin/sh
/bin/kill `cat /Applications/MAMP/db/mongo/tmp/mongo.pid`
This works like the previous script, except it kills the mongo.pid process, effectively shutting down Mongo.
To have MAMP automatically call these Mongo startup scripts, open the /Applications/MAMP/bin/start.sh and /Applications/MAMP/bin/stop.sh files, and insert the following lines above the startMysql.sh lines, respectively:
1
/Applications/MAMP/bin/startMongo.sh
1
/Applications/MAMP/bin/stopMongo.sh
Now MAMP will automatically launch Mongo upon startup.
The only thing left to do is tell PHP to run the mongo.so extension. If you’re running MAMP Pro, edit the php.ini file by selecting File > Edit Template > PHP 5.3 php.ini, otherwise you’ll need to lookup the path the php.ini file from the MAMP startup screen, under “phpInfo” and “Loaded Configuration File.”
Insert the following line in the php.ini file/template, save the file, then restart MAMP.
1
extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/mongo.so"
Mongo should now run in the background on MAMP, which you can connect with from PHP using the main connection routines listed on the PHP site. Welcome to NoSQL on MAMP!
MAMP is now at version 2.2, which comes with PHP v 5.5.3. I managed to get Mongodb working had to jump through a few hoops to get there.
Start with a clean install of MAMP 2.2, make sure that's working.
1. I made this the system version of PHP, (not sure if necessary at this stage).
Find out the default version of php you are using, with the terminal command
$ which php
/usr/bin/php
Then back this up
$ sudo mv /usr/bin/php /usr/bin/php.bak
Then create a symlink to the MAMP latest version of php
$ sudo ln -s /Applications/MAMP/bin/php/php5.5.3/bin/php /usr/bin/php
Check this has been updated
$ which php
/Applications/MAMP/bin/php/php5.5.3/bin/php
2. Installing Mongo
$ cd /Applications/MAMP/db
$ curl http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.6.tgz > mongodb.tgz
$ tar -zxvf mongodb.tgz
$ rm mongodb.tgz
$ mv mongodb* mongo
$ mkdir mongo/data/db
Test to make sure mongo is working
$ ./mongo/bin/mongod --dbpath /Applications/MAMP/db/mongo/data/db
Should output some code, ending in 'waiting for connections on port 27017' press Ctrl + C to quit for now.
3. Now we can create a script to start/stop mongod automatically from the MAMP GUI. This inspiration came from a previous answer, by Alexandru Rada, but didn't quite work how he explained - I think this is to do with being a newer MAMP version.
In /Applications/MAMP/bin create a file called startMongo.sh and insert the following
# /bin/sh
/Applications/MAMP/db/mongo/bin/mongod --dbpath /Applications/MAMP/db/mongo/data/db --logpath /Applications/MAMP/logs/mongodb.log --pidfilepath /Applications/MAMP/tmp/mongo/mongo.pid --fork --logappend
I also created the mongo tmp folder at /Applications/MAMP/tmp/mongo
In the same bin directory create a file called stopMongo.sh and insert the following:
# /bin/sh
/bin/kill `cat /Applications/MAMP/tmp/mongo/mongo.pid`
Make these files executable
$ chmod 775 /Applications/MAMP/bin/startMongo.sh /Applications/MAMP/bin/stopMongo.sh
Now update the startApache.sh and stopApache.sh scripts to include our new files respectively.
Use the Activity Monitor in /Applications/Utilities and search for mongod. When you now start MAMP you should see the process mongod is started. When you stop or quit MAMP you should see this process is automatically killed.
4. We still need to install the mongo-php driver, which is also a pain. To do this I added the MAMP bin directory to my bash $PATH variable. To do this I had to edit the hidden file ~/.profile - but be aware that your $PATH might be loaded from somewhere else.
export PATH=$PATH:/Applications/MAMP/bin/php/php5.5.3/bin:/Applications/MAMP/db/mongo/bin
Note that each element is separated by a :. Quit terminal and re-open, then $ echo $PATH to check your new directories have been added to the path. You could also try $ which pecl or $ which mongod.
We still need some extras from PHP php.net download the same php stable version and unzip it. Create the folder 'include' at /Applications/MAMP/bin/php/php5.5.3/include . Drag the unzipped stable version of php to the include folder, and rename it to just 'php'.
$ cd /Applications/MAMP/bin/php/php5.5.3/include/php
$ ./configure
Now at last, we can hopefully run
$ sudo pecl install mongo
5. Now we just need to update our php config file to add the mongo.so extension.
Open /Applications/MAMP/bin/php/php5.5.3/conf/php.ini in a text editor, under the 'extensions' section, add in
extension=mongo.so
Quit and re-open MAMP!
Mac OS X 10.6 Snow Leopard (with the newest updates) has PHP 5.3 installed along with Apache.
You can enable the installed Apache in System Preferences, Sharing, Web Sharing (there is a help icon (?) which shows you details on using the system's web server).
See also this StackOverflow question:
Easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard)?
Here's the way I did it and it was fairly simple.
First, read what Mongo says # http://www.mongodb.org/display/DOCS/PHP+Language+Center
When you run sudo pecl install mongo it's going to install it for the standard OSX PHP installation to use, so if for some reason you're using the built-in Apache installation.
Like you, I like using MAMP. I didn't want to go through figuring how to download Mongo into MAMP, so I just creating a symbolic link in the MAMP PHP Extensions folder and put the extension line in the MAMP php.ini. Restarted MAMP Apache and everything worked beautifully!
A couple things to note, after installing Mongo, note the extensions folder it installed it into then check MAMP php.ini to see where it has its extensions set to be. You'll notice the ending is very similar.
For MAMP PRO 2.0.5
You may compile your own mongo.so (http://m-schmidt.eu/2011/11/06/develop-mongodb-web-apps-with-mamp-under-mac-os-x/) or download compiled (http://www.davidgolding.net/mongodb/installing-mongodb-on-mamp-1-9-5.html).
I'd like compile.
After steps mongo.so don't include to php configuration, because in MAMP PRO php.ini placed in
/Applications/MAMP PRO/MAMP PRO.app/Contents/Resources
I using php5.3.6.ini file for my configuration.