Results 1 to 9 of 9

Thread: Creating a project in laravel

  1. #1
    Join Date
    Sep 2003
    Posts
    3,040

    Default Creating a project in laravel

    To create a project in laravel, run

    Code:
    cd ~/www
    composer create-project laravel/laravel your-project-name --prefer-dist
    Lets say, you want to create a site YOURNAME.DEV, you run


    Code:
    cd ~/www
    composer create-project laravel/laravel yourname.dev --prefer-dist
    Now you will see a folder yourname.dev in your www folder.

    composer will download many files required for laravel and put them in vendor folder.

    Now to start built-in dev server, run

    Code:
    cd ~/www/yourname.dev
    php artisan serve
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  2. #2
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    @sherly

    For you, the commands will be

    Code:
    cd ~/www
    composer create-project laravel/laravel sherly.dev --prefer-dist
    Once composer finished it work, you need to do

    Code:
    cd ~/www/sherly.dev
    php artisan serve
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  3. #3
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    When I run below command:

    php artisan serve

    I get following result:


    Code:
    [email protected]:~/www$ cd ~/www/sherly.dev
    [email protected]:~/www/sherly.dev$ php artisan serve
    Mcrypt PHP extension required.
    [email protected]:~/www/sherly.dev$

  4. #4
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    This is because PHP extension Mycrypt not installed on your computer. To install, run

    Code:
    sudo apt-get install php5-crypt
    sudo php5enmod mcrypt
    sudo service apache2 restart
    Tell me if that fixed the problem.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  5. #5
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    Please find the result as follows:


    Code:
    [email protected]E:~/www/sherly.dev$ sudo apt-get install php5-crypt
    [sudo] password for sherly: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package php5-crypt
    [email protected]:~/www/sherly.dev$ sudo php5enmod mcrypt
    WARNING: Module mcrypt ini file doesn't exist under /etc/php5/mods-available
    WARNING: Module mcrypt ini file doesn't exist under /etc/php5/mods-available
    [email protected]:~/www/sherly.dev$ sudo service apache2 restart
     * Restarting web server apache2                           AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                                                                             [ OK ]

  6. #6
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    @sherly

    When running commands, be careful. Read what it says. Your first command itself failed. Then stop and inventigate. Don't continue with further commands if first one failed.

    When running a group of commands, don't run all at once, run one at a time, read what computers says, if it was success or failure.

    Code:
    [email protected]:~/www/sherly.dev$ sudo apt-get install php5-crypt
    [sudo] password for sherly: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package php5-crypt
    See, server can't find the package with name php5-crypt.

    Actual name of the package is

    Code:
    php5-mcrypt
    So run

    Code:
    sudo apt-get install php5-mcrypt
    I am not fixing first post, that is error on my part. Lets keep that error, so others follow this post know what to do when an error happens or something did not work. Read what computer said and try to understand. No 6th sense needed here.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  7. #7
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    Code:
    sudo apt-get install php5-mcrypt
    sudo php5enmod mcrypt
    sudo service apache2 restart
    Code:
    [email protected]:~$ sudo apt-get install php5-mcrypt
    [sudo] password for sherly: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
      linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      libmcrypt4
    Suggested packages:
      libmcrypt-dev mcrypt
    The following NEW packages will be installed:
      libmcrypt4 php5-mcrypt
    0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
    Need to get 74.7 kB of archives.
    After this operation, 300 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libmcrypt4 i386 2.5.8-3.1ubuntu1 [61.1 kB]
    Get:2 http://ppa.launchpad.net/ondrej/php5/ubuntu/ trusty/main php5-mcrypt i386 5.5.19+dfsg-1+deb.sury.org~trusty+1 [13.7 kB]
    Fetched 74.7 kB in 1s (57.1 kB/s)                                        
    Selecting previously unselected package libmcrypt4.
    (Reading database ... 451236 files and directories currently installed.)
    Preparing to unpack .../libmcrypt4_2.5.8-3.1ubuntu1_i386.deb ...
    Unpacking libmcrypt4 (2.5.8-3.1ubuntu1) ...
    Selecting previously unselected package php5-mcrypt.
    Preparing to unpack .../php5-mcrypt_5.5.19+dfsg-1+deb.sury.org~trusty+1_i386.deb ...
    Unpacking php5-mcrypt (5.5.19+dfsg-1+deb.sury.org~trusty+1) ...
    Processing triggers for libapache2-mod-php5 (5.5.19+dfsg-1+deb.sury.org~trusty+1) ...
    Setting up libmcrypt4 (2.5.8-3.1ubuntu1) ...
    Setting up php5-mcrypt (5.5.19+dfsg-1+deb.sury.org~trusty+1) ...
    
    Creating config file /etc/php5/mods-available/mcrypt.ini with new version
    php5_invoke: Enable module mcrypt for cli SAPI
    php5_invoke: Enable module mcrypt for apache2 SAPI
    Processing triggers for libc-bin (2.19-0ubuntu6.4) ...
    Processing triggers for libapache2-mod-php5 (5.5.19+dfsg-1+deb.sury.org~trusty+1) ...
    [email protected]:~$ sudo php5enmod mcrypt
    [email protected]:~$ sudo service apache2 restart
     * Restarting web server apache2 
     AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                                                                             [ OK ]
    Last edited by sherlyk; 12-15-2014 at 07:21 AM.

  8. #8
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Run

    Code:
    cd ~/www/yourname.dev
    php artisan serve
    Paste the result here. So we can see what it will be like when built-in web server working properly.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  9. #9
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    Quote Originally Posted by admin View Post
    Run

    Code:
    cd ~/www/yourname.dev
    php artisan serve
    Paste the result here. So we can see what it will be like when built-in web server working properly.


    Result

    Code:
    [email protected]:~$ cd ~/www/sherly.dev/
    [email protected]:~/www/sherly.dev$ php artisan serve
    Laravel development server started on http://localhost:8000
    [Mon Dec 15 11:56:09 2014] 127.0.0.1:41676 [200]: /favicon.ico
    [Mon Dec 15 11:56:09 2014] 127.0.0.1:41677 [200]: /favicon.ico

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •