How to install cakephp 3.1.6 on LAMP - php

I want to install cakephp3 on ubuntu14.0.4 in lamp. I put cakephp3 folder in /var/www/ path. When I enter localhost/cakephp3/in browser, nothing is shown.
What should I do?

Follow this,
http://book.cakephp.org/3.0/en/installation.html#installing-cakephp
open terminal,
Create a folder in var/www/html
mkdir /var/www/html/cakephp3
Navigate to this folder and install composer there
cd /var/www/html/cakephp3
curl -s https://getcomposer.org/installer | php
Install php in the same folder
php composer.phar create-project --prefer-dist cakephp/app
You must get your cakephp application now.

My error.log :
127.0.0.1:59267] PHP Fatal error: You must enable the intl extension to use CakePHP. in /var/www/html/cakephp-3-1-6/config/bootstrap.php on line 38
So
install "intl" plugin:
sudo apt-get install php5-intl
and restart apache:
sudo service apache2 restart
And Try again in browser: localhost/cakephp3/
It worked for me.

Related

How to run the yii after installation in ubuntu?

I have installed the yii framework successfully.I have installed it via composer. The location of my folder is /var/www/yii-test/advanced/.
I have opened my terminal and executed the below command.
cd /var
cd www
php /var/www/yii-test/advance/advanced/yiic webapp myyii
after executing this I got the below error.
Could not open input file: /var/www/yii-test/advance/advanced/yiic
so what is the sequence of executing the command and is this right way to setup the yii.
myyii is the folder name where I will keep the my yii application.
Just run this command init or php init (I don't remember which) in the root path. In advance projects you have to start your environment.
You can directly follow the steps from Step-7 to Step 10.
1)install curl.
sudo apt-get install curl
2)install php5-cli package
sudo apt-get install php5-cli
3) install the php5-mysql package
sudo apt-get install php5-mysql
4) install php5-mcrypt package.
sudo apt-get install php5-mcrypt
5) activate php5-mcrypt package.
sudo php5enmod mcrypt
6) install php5-gd package
sudo apt-get install php5-gd
7) install Composer
curl -sS https://getcomposer.org/installer | php
8) install it globally
sudo mv composer.phar /usr/local/bin/composer
9)Move to your localhost web root folder
cd /opt/lampp/htdocs/
10)To install
a)basic template
composer create-project --prefer-dist yiisoft/yii2-app-basic
Type in url: localhost/yii2-app-basic/web/
b)advanced template
composer create-project --prefer-dist yiisoft/yii2-app-advanced advanced
Type in url: localhost/yii2-app-advanced/web/
Or, Check This Link Install Yii2 To Install.
Cheers !

Laravel - Unable to open composer.phar file

Hey just started working on laravel. First day for me. Not much idea. Step by step following the steps from documentation given by https://www.laravel.com
After installing composer on my desktop at root folder. As soon, i opened composer.phar, it showed this error -> there is a problem opening the file "/root/composer.phar"
I followed steps given in https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx .
apt-get install curl
apt-get install php5-cli
curl-sS https://getcomposer.org/installer | php
php composer.phar
Is there any problem ? Please help me........
For installing composer try follow this
sudo apt-get install curl
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
Setting up Laravel
Run only composer and see if composer is installed.
If yes then let's install laravel installer to quickly install laravel. Run this command from your command line composer global require "laravel/installer=~1.1"
Now if you are using zsh then add this line to user home directories .zshrc file export PATH="~/.composer/vendor/bin:$PATH"
Else add this lines to .bashrc file export PATH="~/.composer/vendor/bin:$PATH"
Now you can run laravel new blog and a new laravel installation will be downloaded.
Now run php artisan serve from that directory to serve your laravel
See http://laravel.com/docs/5.1/#installation for more details
Tips: You can create a separate file and include it to your
.zshrc or .bashrc

Install laravel.phar in Linux Mint 16

I just downloaded laravel.phar and copied it to /bin with the proper permissions but upon running laravel.phar new test I get the error
Crafting application...
[Guzzle\Common\Exception\RuntimeException]
The PHP cURL extension must be installed to use Guzzle.
I already have curl installed after previously running sudo apt-get install curl. Am I still missing something?
EDIT: I installed lamp using sudo apt-get install lamp-server^ in case you needed to know.
You can install the cURL extension with:
sudo apt-get install php5-curl
You have to enable your curl extension. You can enable this from your php.ini file. You have to uncomment it by removing the ; before the extension=php_curl.dll inside that ini file.
I think the article will be useful to install laravel using laravel.phar file.
kvcodes

Composer install error - requires ext_curl when it's actually enabled

I'm trying to install Facebook PHP SDK with Composer. This is what I get
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for facebook/php-sdk dev-master -> satisfiable by facebook/php-sdk[dev-master].
- facebook/php-sdk dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem is, I have curl extension enabled (uncommented in php.ini). When I run phpinfo(), it says it's enabled.
Only clue I have is that when I run $ php -m, 'curl' line is missing but I don't know what to do about it.
I have wamp 2.4 on Win8 and I'm running composer in cmd.exe.
This is caused because you don't have a library php5-curl installed in your system,
On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation
sudo apt-get install php5-curl
For anyone who uses php7.0
sudo apt-get install php7.0-curl
For those who uses php7.1
sudo apt-get install php7.1-curl
For those who use php7.2
sudo apt-get install php7.2-curl
For those who use php7.3
sudo apt-get install php7.3-curl
For those who use php7.4
sudo apt-get install php7.4-curl
For those who use php8.0
sudo apt-get install php8.0-curl
Or simply run below command to install by your version:
sudo apt-get install php-curl
This worked for me: http://ubuntuforums.org/showthread.php?t=1519176
After installing composer using the command curl -sS https://getcomposer.org/installer | php just run a sudo apt-get update then reinstall curl with sudo apt-get install php5-curl. Then composer's installation process should work so you can finally run php composer.phar install to get the dependencies listed in your composer.json file.
on php7 run for example:
> sudo apt-get install php-curl
> sudo apt-get install php-mbstring
for every missing extension. Then:
> sudo apt-get update
and finally (in the project's root folder):
> composer install
As Danack said in comments, there are 2 php.ini files. I uncommented the line with curl extension in the one in Apache folder, which is php.ini used by the web server.
Composer, on the other hand, uses php for console which is a whole different story. Php.ini file for that program is not the one in Apache folder but it's in the PHP folder and I had to uncomment the line in it too. Then I ran the installation again and it was OK.
I ran into the same issue trying to install Dropbox SDK.
CURL was indeed enabled on my system but this meant by the php.ini in the wamp\bin\apache folder.
I simply had to manually edit the php.ini situated in wamp\bin\php, uncomment the extension=php_curl.dll line, restart Wamp and it worked perfectly.
Why there are those 2 php.ini and only one is used is still a mystery for me...
Hope it's helpul to someone!
I had this problem after upgrading to PHP5.6. My answer is very similar to Adriano's, except I had to run:
sudo apt-get install php5.6-curl
Notice the "5.6". Installing php5-curl didn't work for me.
For anyone who encounters this issue on Windows i couldn't find my answer on google at all.
I just tried running composer require ext-curl and this worked.
Alternatively add the following in your composer.json file:
"require": {
"ext-curl": "^7.3"
}
According to https://github.com/composer/composer/issues/2119 you could extend your local composer.json to state that it provides the extension (which it doesn't really do - that's why you shouldn't publicly publish your package, only use it internally).
I ran into a similar issue when trying to get composer to install some dependencies.
It turns out the .dll my version of Wamp came with had a conflict, I am guessing, with 64 bit Windows.
This url has fixed curl dlls: http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
Scroll down to the section that says: Fixed Curl Extensions.
I downloaded "php_curl-5.4.3-VC9-x64.zip". I just overwrote the dll inside the wamp/bin/php/php5.4.3/ext directory with the dll that was in the zip file and composer worked again.
I am running 64 bit Windows 8.
Hope this helps.
if use wamp go to:
wamp\bin\php\php.5.x.x\php.ini
find:
;extension=php_curl.dll
remove (;)
Enable in php 7 try below command
sudo apt-get install php7.0-curl
Not sure why an answer with Linux commands would get so many up votes for a Windows related question, but anyway...
If phpinfo() shows Curl as enabled, yet php -m does NOT, it means that you probably have a php-cli.ini too. run php -i and see which ini file loaded. If it's different, diff it and reflect and differences in the CLI ini file. Then you should be good to go.
Btw download and use Git Bash instead of cmd.exe!
I have Archlinux with php 7.2, which has Curl integrated, so no amount of configuration voodoo would make Composer see ext-curl, that PHP could see and work with happily. Work around is to use Composer with --ignore-platform-reqs.
eg composer update --ignore-platform-reqs
Reference = https://github.com/composer/composer/issues/1426
try install php5-curl by using below snippet.
sudo apt-get install php5-curl
if it won't work try below code i m sure it will work fine.
sudo apt-get install php-curl
for me it worked... all the best :)
In my case I moved from PHP5 to PHP7 and I ve got this error,
Simply go to your /bin/php/php7/php.ini , then uncomment extension=php_curl.dll and restart your server, re-run your composer install.
If you getting error like php7.2-curl doesn't have installable candidate or not locate any package or dependencies is php7.2-common Or libcurl3 Do this
You have to tackle in mature way. Install aptitude these ubuntu package manager will finds all dependencies, and will install one by one.
apt-get install aptitude
Now you have to check if aptitude can download it or not if download it follow instructions
sudo aptitude install php7.2-curl
If you have gotten any error like this
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'
Any type on error i'm not talking about proper these errors
Try to add php package again
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
Now try this command
sudo aptitude install php7.2-curl
Aptitude will ask you you want to keep current version of all dependencies
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) php7.2-curl [Not Installed]
Accept this solution? [Y/n/q/?]
Type n then Enter
Aptitude will find all dependencies and ask you to install all package type
y
Again
y
Then
systemctl restart apache2
For centos of rhel
systemctl restart httpd
It will Not enabling PHP 7.2 FPM by default.
NOTICE: To enable PHP 7.2 FPM in Apache2 do
a2enmod proxy_fcgi setenvif
a2enconf php7.2-fpm
This method is not only for this error you can find any of php apache2 or ubuntu system package solution using aptitude.
Upvote if you find your solution
If you are ubuntu, this will work for you.
composer update --ignore-platform-reqs

Fatal error: Class 'SoapClient' not found

I'm trying a simple web service example and I get this error even though I uncommented extension=php_soap.dll in the php.ini file:
Fatal error: Class 'SoapClient' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\server.php on line 2
Diagnose
Look up the following inside your script file
phpinfo();
If you can't find Soap Client set to enabled like so:
Fix
Do the following:
Locate php.ini in your apache bin folder, I.e Apache/bin/php.ini
Remove the ; from the beginning of extension=php_soap.dll
Restart your Apache server
Look up your phpinfo(); again and check if you see a similar picture to the one above
If you do, problem solved!
On the other hand if this doesn't solve your issue, you may want to check the requirements for SOAP here. Also in the comment section you can find good advice on connecting to https.
To install SOAP in PHP-7 run following in your Ubuntu terminal:
sudo apt-get install php7.0-soap
To install SOAP in PHP-7.1 run following in your Ubuntu terminal:
sudo apt-get install php7.1-soap
To install SOAP in PHP-7.2 run following in your Ubuntu terminal:
sudo apt-get install php7.2-soap
To install SOAP in PHP-7.3 run following in your Ubuntu terminal:
sudo apt-get install php7.3-soap
For AWS (RHEL):
sudo yum install php56-soap
(56 here is 5.6 PHP version - put your version here).
To install SOAP in PHP5.6 run following in your Ubuntu 14.04 terminal:
sudo apt-get install php5.6-soap
service php5.6-fpm restart
service apache2 restart
See if SOAP was enabled:
php -m
(You should see SOAP between returned text.)
I had to run
php-config --configure-options --enable-soap
as root and restart apache.
That worked! Now my phpinfo() call shows the SOAP section.
I solved this issue on PHP 7.0.22-0ubuntu0.16.04.1 nginx
sudo apt-get install php7.0-soap
sudo systemctl restart php7.0-fpm
sudo systemctl restart nginx
I couln't find the SOAP section in phpinfo() so I had to install it.
For information the SOAP extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required according to http://php.net/manual/en/soap.requirements.php
From WHM panel
Software » Module Installers » PHP Extensions & Applications Package
Install SOAP 0.13.0
WARNING: "pear/HTTP_Request" is deprecated in favor of "pear/HTTP_Request2"
install ok: channel://pear.php.net/SOAP-0.13.0
Install HTTP_Request2 (optional)
install ok: channel://pear.php.net/HTTP_Request2
Restart Services » HTTP Server (Apache)
From shell command
1.pear install SOAP
2.reboot
For XAMPP users, open php.ini file located in C:/xampp/php and remove the ; from the beginning of extension=soap. Then restart Apache and that's it!
For Docker* add this line:
RUN apt-get update && \
apt-get install -y libxml2-dev && \
docker-php-ext-install soap
*: For debian based images, ie. won't work for alpine variants.
For PHP 7.4 & Docker
add this line in Dockerfile:
RUN apt-get update && apt-get install -y \
libxml2-dev \
RUN docker-php-ext-install soap
Rebuild the image and restart ;)
You have to inherit nusoap.php class and put it in your project directory, you can download it from the Internet.
Use this code:
require_once('nusoap.php');
On Centos 7.8 and PHP 7.3
yum install php-soap
service httpd restart
For PHP 8:
sudo apt update
sudo apt-get install php8.0-soap
In my case, the Symfony cache was causing the problem,
after running composer install the problem was gone.
I had a similar problem. It was due to the scope and solved by replacing new SoapClient by new \SoapClient.

Categories