PHP - Installing Laravel Without Composer
Hi.
My sys admin guy has informed me that installing composer is unlikely. They're a bit jumpy about security around here.
I tried to download and run Laravel on it's own but I'm getting errors when I go to http://example.com/t...laravel/public/
Warning: require(/var/www/html/test/laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/test/laravel/bootstrap/autoload.php on line 17 Fatal error: require(): Failed opening required '/var/www/html/test/laravel/bootstrap/../vendor/autoload.php' (include_path='.:/php/includes:/var/www/html/php/includes:/jpa/release/jpa/includes:/usr/share/pear:/usr/share/php/phpmailer:/apache/htdocs/applications/surveys/Includes:/var/lib/ZF1/library') in /var/www/html/test/laravel/bootstrap/autoload.php on line 17I'm very new to Laravel and I am basically assuming that the reason for these errors is because i haven't installed all the various dependancies. And that you can only install all the dependancies through Composer. Is this the case? I downloaded the Laravel framework from GitHub Unfortunately.. My only real experience of PHP Frameworks is CodeIgniter. So I've never expoled/used "packages" or "dependancies" and don't really know where they are, or where they go, or what they do! I managed to get Laravel up and running on my personal computer (using Composer).... But, as I've said, I might not be able to do this on my day job server. Any tips? ----- Update ----- Is there a chance I am just misunderstanding the word "Dependancies"? It's not a word I often use. Does it just mean "The PHP files that make up the Laravel Framework"? Edited by Korferer, 19 November 2014 - 08:11 AM. Similar TutorialsI like to set up websites for people who don't have the know how to do it themselves, I mainly set them up wordpress sites cuz thats pretty easy for them to modify and maintain themselves. To save myself time, I decided to learn how to do it with Composer (what a brilliant tool that it). Can anyone who uses composer for this kinda thing, can you post your composer.json files here. Also, if anyone can show me a better way of doing things, it'd be much appreciated. Heres the one I made:
{ "name": "acme/brilliant-wordpress-site", "description": "My brilliant WordPress site", "repositories":[ { "type":"composer", "url":"http://wpackagist.org" } ], "require": { "johnpbloch/wordpress": ">=3.8.0", "wpackagist-plugin/captcha":">=3.9", "wpackagist-plugin/tinymce-advanced":">=4.0.0", "wpackagist-plugin/wordpress-importer":"*", "wpackagist-theme/hueman":"*", "wpackagist-theme/eclipse":"*", "wpackagist-theme/raindrops":"*" }, "extra": { "installer-paths": { "mysite": ["johnpbloch/wordpress"], "mysite/wp-content/plugins/{$name}": ["type:wordpress-plugin"], "mysite/wp-content/themes/{$name}": ["type:wordpress-theme"] } }, "autoload": { "psr-0": { "Acme": "src/" } } }I think I'm doing this in a silly way though. I read about these composer installer things on github, but I didn't figure out how to use them so instead I used the installer-paths key to make the autoloader put the files in the right place. Heres a composer.json file I found which is better cuz it uses a post installation script: { "require": { "wordpress/core": "3.5.2", "wordpress/twentytwelve": "1.1", "wordpress/akismet": "2.5.7", "wordpress/google-sitemap-generator": "3.2.9", "wordpress/google-analytics-for-wordpress": "4.3.3", "wordpress/wordpress-importer": "0.6.1" }, "repositories": [ { "type": "composer", "url": "https://raw.github.com/wordpressoncomposer/composer-repository/master/" }, { "type": "vcs", "url": "https://github.com/wordpressoncomposer/installer" } ], "scripts": { "post-install-cmd": "Wordpress\\Composer\\InstallerTasks::wpConfig" }, "extra": { "wordpress_coredir": "wordpress/core", "wordpress_wp_contentdir": "wordpress/wp-content", "wordpress_wp_config": { "site_url": "http://localhost", "db_host": "localhost", "db_user": "root", "db_pass": "", "db_name": "wordpress" } }, "minimum-stability": "dev" }I'm gonna start using these scripts once I figure out how to use them. Where are the scripts stored? I haven't a clue what this autoload thing is all about either, is it a tool for moving files into the appropriate directories? See how the first file gets wordpress from packagist, and the second one gets it from github. Is there a difference? If I was to add that post-install-cmd key to the first composer.json file, would it still work? In other words, do both repositories contain identical packages. Hi there, I wonder if anyone can help me. I'm trying to install smarty. The problem I'm having is in choosing the correct path directory for- require('/usr/local/lib/php/Smarty/Smarty.class.php'); Granted I am relatively new to coding. I've tried using- <?php echo $_SERVER['DOCUMENT_ROOT']; ?> which returns- /usr/local/apache/htdocs I think the problem is in understanding what my local directory is. In my ftp program, the first folder looks like this firstfolder/ public_html/ ( < I've installed smarty in this one) DO_NOT_UPLOAD_HERE.txt When I run a test file index.php, I get the following error- Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/local/public_html/lib/php/Smarty/Smarty.class.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a4808331/public_html/index.php on line 4 What I've put in my index.php file so far which I'm sure is wrong is- require('/usr/local/public_html/lib/php/Smarty/Smarty.class.php'); If you need more info I'd be happy to supply. Thanks in advance for your help. I have mysql installed. I have just installed myphpadmin and put it in IIS root. When I go to myphpadmin default page it cannot run the scripts. I need to install php I guess, but really have very little idea. Did some searching, but had some difficulty, what is the quickest and easiest way to install php to support my just installed myphpadmin? I have tryied to install this twice and both times i havnt got it working or am just not using it right, any idears or tips? Hello
I have being using MAMP for php I am now trying out symfony framework.
I am trying to install it i do everything the website says but when I come to test the url it don't work says can't connect to server.
I don't think php is enabled on my iMac
wondering if anyone can help me install the framework
thanks
how do i install laravel ?
using composer it asks for php in my local files? do i have to download something for this?
i am just getting into frameworks like larvel
This topic has been moved to Installation on Linux. http://www.phpfreaks.com/forums/index.php?topic=331948.0 1. If I start a new project, should I use Laravel 5.0(dev) or 4.2?
2. How easy is it to upgrade from between major version like that?
3. Any design recommendations for daily with authentication and accounts?
This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=322457.0 I've only seen composer packages using vendor name and package name namespace. Is it possible to use deeper namespace such as the following? For instance, package: { "name": "notioncommotion/my-sub-namespace/my-package", "description": "MyPackage located in MySubNamespace.", ... } is used in some project: { "require": { "notioncommotion/my-sub-namespace/my-package": "^1.2" } } If not, what do you think were the reasons composer does not allow? Thanks I'm beginning to study Composer and am developing a system where I separate the files core application files, as follows:
/root |-- /src |-- /App |-- /DBConfig |-- /Controller |-- /Model |-- /Core |-- /Helper |-- /Controller |-- /ModelSo, to set this setting in composer.json file and get access to all classes both /App much /Core would be this way? "autoload" : { "psr-X" : { "App\\" : "/src", "Core\\" : "/src" } }Or is there a more correct way? I have also read about PSR-0 vs PSR-4 and I am still somewhat in doubt which one to use. In my case what should I implement, PSR-0 or PSR-4? php74 is installed as my primary php, but I am also working with a different framework that can only use php73 and set up a separate pool to deal with it. Recently, my installed composer1 told me I should upgrade to composer2 and I did so, but then found that the previously mentioned other framework also doesn't work with composer2 but only composer1. When updating a package with composer, sometimes I get composer errors or even worse no composer errors but PHP errors later on where classes don't exist, and I think it relates to using the wrong version of PHP (and maybe even composer). Is it always required to consistently use composer with a single version of PHP? Anything to worry about different versions of composer or will I just get a message. Any other best practices? Any issues how I set up composer below? Thanks! curl -sS https://getcomposer.org/installer | php # or if desired, use resulting composer.phar as: $ php (or php73) composer.phar update/install/etc chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer sudo ln -s /usr/local/bin/composer /usr/local/bin/composer2 curl -sS https://getcomposer.org/installer | php73 chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer2_73 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php --version=1.10.19 chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer1 php73 composer-setup.php --version=1.10.19 chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer1_73 rm composer-setup.php
I work on laravel app with my sql database mvc I modify some thing on html pages and then i run my app then write php artisan serve but after site run i dont see changes on html can you please help me I am really struggling with the logic aspect of my application. I can't picture the structure and get it clear in my mind. As a result, I can't code anything because I'm second-guessing myself at every turn.
My application is pretty simple in reality. It's an application that keeps a record of all the different 'contracts'/'agreements' that my colleagues have signed. Some will have signed three or four depending on what systems they are working on.
The application will run a cron, daily, and send out an email to anyone who's contract/agreement is about to expire with an invite for them to renew it.
I have already built an application that has a login system and authentication (using Laravel). It was my first Laravel effort and I did it using a tutorial from YouTube. I figured I could use the one login from that to act as the administrator for this whole application. Once the administrator is in, they will be presented with a panel to do various things. This is the part I am stuck on. What do you all think of my "logic"?
Here are the basic routes (forgetting the auth stuff which is already done);
/contracts - to see a list of all the contact templates out there.
/contracts/{contract-id} - to view the specific contract template
/contracts/create - GET and POST to be able to add new contract templates for other systems
/people - view all my colleagues on one page
/people/{person-id} - view a specific colleague and all the contracts they have signed
/people/create - GET and POST for this too to be able to add new colleagues to the system
/people/{person-id}/create-new-contract - so this would add a record in to a third table which joins info from the people table and the contracts table to make a list of unique contract agreements for each person and their expiry date. GET and POST for this as well I suppose. Even as I'm writing this, I don't know if this will be needed because I might have an emailing class that might do this job better? Hence the writing of this post!
/agreements/renew/{renew-code} - This will create a new record in the table and amend the old one to show that the previous agreement has expired and that a new one for the next 365 days is in place.
As you can probably tell.. I am struggling a bit. Is there any advice you can give me to help me mentally map out my application before I start coding? I just want to get it right..
Hello everyone, I have a PHP Laravel CRUD application I made where I am using MVC style. I have controllers views and models. My database migration is made and my table in the database is made with php artisan migrate. I am using php 7.3 and laravel 5.8. On my create view I go to create a single object in my database and my errors are thrown saying nothing in text box (no input) If I comment out the errors then just I click my submit button and nothing happens nothing is entered into my db. I have looked at many different crud examples and I am not sure why my object isn’t being created. Here is what I have
//view create @section('main') <section id="section-content" class="text-center"> <div class="container contentdiv rounded"> <div class="row"> <div class="col-md-12"> <div class="pb-2 mt-4 mb-2 border-bottom clearfix"> <h2>Create Contact</h2> </div> <div > <a class="btn btn-success" href="{{route('contacts.index')}}">Back</a> </div> </div> <!-- <div class="col-md-10 mx-auto"> @if($errors->any()) <div class="alert alert-danger"> <ul> @foreach($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div><br /> @endif </div> --> <div class="row"> <div class="col-md-10 mx-auto mt-3"> <form method="POST" action="{{ route('contacts.store') }}"> @csrf <div class="form-group row"> <label for="txtfn" class="col-sm-3"><b>First Name:</b></label> <div class="col-sm-9"> <input type="text" class="form-control" name="txtfn" id="txtfn"/> </div> </div> <div class="form-group row"> <label for="txtln" class="col-sm-3"><b>Last Name:</b></label> <div class="col-sm-9"> <input type="text" class="form-control" name="txtln" id="txtln"/> </div> </div> <div class="form-group row"> <label for="txtem" class="col-sm-3"><b>Email:</b></label> <div class="col-sm-9"> <input type="text" class="form-control" name="txtem" id="txtem"/> </div> </div> <button type="submit" class="btn btn-primary">Create Contact</button> </form> </div> </div> </div> </section> //controller namespace App\Http\Controllers; use App\Contact; use Illuminate\Http\Request; class ContactController extends Controller { public function store(Request $request) { $request->validate([ 'first_name' => 'required', 'last_name' => 'required', 'email' => 'required' ]); $contact = new Contact([ 'first_name' => $request->get('first_name'), 'last_name' => $request->get('last_name'), 'email' => $request->get('email'), 'job_title' => $request->get('job_title'), 'city' => $request->get('city'), 'country' => $request->get('country') ]); $contact->save(); return redirect('/contacts')->with('success', 'Contact saved!'); } public function index() { $contacts = Contact::all(); return view('contacts.index', compact('contacts')); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { return view('contacts.create'); } // model namespace App; use Illuminate\Database\Eloquent\Model; class Contact extends Model { protected $fillable = [ 'first_name', 'last_name', 'email', 'city', 'country', 'job-title' ]; } My env is setup correctly I just don’t get the not creating object. I'm looking for one or two talented Laravel guys in the Dallas area who write clean code, document well, and love pushing the limits of their own abilities. It is important that the developers we hire are local. Please do not respond if you do not live in the Dallas area.
Preferred knowledge
- Laravel
- AngularJS
- NodeJS
- jQuery
- MySQL
- HTML/CSS
- e-Commerce
- Paranoid about security
- Performance minded
We are developing applications that will process millions of dollars in transactions every month. Performance, security, and the ability to scale is paramount.
Thank you
Does anyone know how I can go about downloading a specific build of PHP on a Raspberry Pi running Raspbian?
I want to try to create a development/testing webserver using the Pi, but I want it to have the same versions of PHP and MySQL that are on my actual production server (which is shared hosting using a web host).
So far, using apt-get, all it does is install the latest version available, which I don't want to do. I want a specific version to closely imitate the actual production server.
Ideas?
how to install linux on a netbook without a dvd-drive.
i think about buying a new notebook there are several ones that come up to mind. question should i buy one without a dvd-drive? there are many many out there - eg the ACER Aspire V3-371-36MA but many of them do not have a dvd. question: how can i install suse linux on this notebook and how should / could i do an update. well - do you reccomend to buy a notebook with a. a dvd drive - is this mandantory b. a notebook with more than 4 gb ram!? love to hear from you I want to install this package:
https://github.com/composer/installers
from GitHub, I can easily git clone it but I think its better I get experienced with composer. In the readme they onyl give one example, one involving CakePHP:
{ "name": "you/ftp", "type": "cakephp-plugin", "require": { "composer/installers": "~1.0" } }but I that isn't much help to me since I'm not making composer.json files to hold a single framework or plugin, my json files look more like this: { "name": "example-app", "require": { "cakephp/cakephp": ">=2.5.1", "cakephp/debug_kit": "2.2.*", "slywalker/boost_cake": "*", "CakeDC/tags": "1.*", "CakeDC/utils": "*", "CakeDC/migrations": "*", "FriendsOfCake/crud": "*", "CakeDC/search": "*", "paulredmond/chosen-cakephp": "*" }, "config": { "vendor-dir": "Vendor/" }, "extra": { "installer-paths": { "app/Plugin/Tags": ["CakeDC/tags"], "app/Plugin/BoostCake": ["slywalker/boost_cake"] } } }Right now I'm working on a WordPress one and it is 10 times longer than that. So what I was wondering is if its better to split it up into a few composer.json files. As in one file for setting up the framework and configuring it, when its done, it calls a second composer.json file that will take care of installing the plugins. Like this I suppose I could store a bunch of composer.json files in a central location, each of them has a specific purpose, so if I need to use one of them for a project, I just call composer.phar file (which I can access globally), and use that global keywork to make the json file operate like its in my projects directory. I don't understand what this autoload thing is about at all, but its nice the way it lets you run scripts at particular times during the execution of the json file. Is this actually a better way to work with composer, by chaining separate composer.json files together? A big issue is the name conflict thing, is there a way to make composer.phar process files with different names? It be a pain in the ass having to make the scripts alter the filenames. That gets me thinking about something. Can we define variables in composer.json files? If not, I suppose its not very hard to do it anyway by editing the file. I was thinking there that a composer file generator would be pretty useful. Like say on CakePHPs website, theres a page that lets you check plugins and features that you want for your new installation, then it makes a composer.json file for you. I think I am close, but not sure if I am quite there. Am I doing this correctly? I have several entity classes which will use class type inheritance:
MyNamespace\MyApp\Vehicle\Vehicle #MyNamespace.MyApp.Vehicle.Vehicle.dcm.yml MyNamespace\MyApp\Vehicle\Vehicle: type: entity table: vehicle_table inheritanceType: JOINED discriminatorColumn: name: discriminator_column type: string discriminatorMap: vehicle: Vehicle groundVehicle: MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle airVehicle: MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle repositoryClass: Vehicle id: id: type: integer generator: strategy: AUTO fields: grandParentItem1: type: string grandParentItem2: type: string #MyNamespace.MyApp.Vehicle.AirVehicle.AirVehicle.dcm.yml MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle: type: entity table: air_vehicle extends: MyNamespace\MyApp\Vehicle\Vehicle inheritanceType: JOINED discriminatorMap: airVehicle: AirVehicle airplane: MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane rocket: MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket repositoryClass: AirVehicle id: id: associationKey: true fields: parentItem1: type: string parentItem2: type: string #MyNamespace.MyApp.Vehicle.AirVehicle.Rocket.Rocket.dcm.yml MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket: extends: MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle type: entity table: rocket_table id: id: associationKey: true repositoryClass: Rocket fields: childItem1: type: string childItem2: type: string I haven't shown GroundVehicle or Train, Car, and Airplane, but they are almost identical to AirVehicle and Rocket, respectively.
I've discovered that the barebone entities need to be manually created prior to using orm:generate-entities else I get class not found errors, and have created them as shown below. [michael@devserver doctrine]$ find inheritance_src -name "*.php" -exec cat {} \; <?php namespace MyNamespace\MyApp\Vehicle\AirVehicle\Airplane; class Airplane extends \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\AirVehicle\Rocket; class Rocket extends \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\AirVehicle; abstract class AirVehicle extends \MyNamespace\MyApp\Vehicle\Vehicle{} <?php namespace MyNamespace\MyApp\Vehicle\GroundVehicle\Car; class Car extends \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\GroundVehicle\Train; class Train extends \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\GroundVehicle; abstract class GroundVehicle extends \MyNamespace\MyApp\Vehicle\Vehicle{} <?php namespace MyNamespace\MyApp\Vehicle; abstract class Vehicle{} I then am able to successfully create the entities using orm:generate-entities, schema using orm:schema-tool:create, and repositories using orm:generate-repositories. Does everything seem correct? A couple of issues which I have my doubts: Locating the classes in inheritance_src/MyNamespace/MyApp instead of inheritance_src/MyApp. I tried to do the later and modify my psr-4 autoloader to use "MyNamespace\\": "inheritance_src/", but could not get it working without first creating the entities, editing them to add the "abstract" and "extend" portions, and then moving them to one directory lower. Needing to manually create the barebone classes in the first place. My meta-data definitions includes "extends: MyNamespace\MyApp\Vehicle\Vehicle", so I would thought it would not be necessary. Locate both the entities and repositories in the same folder. For that matter, I will probably be locating my service in the same folder as well. It seems that most frameworks will locate all the entities in one folder (with of course subdirectories), repositories in another, services in another, etc. The way I am doing seems to be organized domain modules as described by https://mnapoli.fr/organizing-code-into-domain-modules/. Any compelling reasons to do it one way or the other?
Thank you |