I've a lamp stack installed on my localhost. I just installed everything I needed via the command line, but I'm not very knowledgable about how the server works.
So when I just start a very simple php project from scratch, simply make a folder in the root directory and create an index.php with phpinfo() at the top, I find that I'm running php 7.3.
Then when I created another folder with a laravel installation inside (I didn't set up, just copied files and made the required changes - it works fine - note I'm just messing about with laravel, no expert!). If I stick a phpinfo() at the top of a file in the laravel project, it says I'm on php7.4!
How is it possible that the two projects, on the same server which are running different php versions?
Related
I'm a bit fresh to Laravel. I installed it via composer in the xampp/htdocs file. I installed the latest version 5.6.
The install works with no errors, and the file structure is as it should be.
When I run the php artisan serve command from inside the folder, it deletes the server.php file and therefore outputs the error:
This site can’t be reached.
localhost refused to connect.
So I thought why not just add a new file inside and it will work... Well, trying to add new file shows that I do not have permissions to add files to this folder.
I tried a new install a few times, but the situation is always the same.
Has anybody else encountered this problem?
So I realised it was some kind of server problem... well, removed the antivirus, chanhed my firewall settings and everithing works as it should.
My advice to avoid this in the future is to start creating Laravel applications in a folder inside of your My Documents folder in Windows or using /home/{your-username}/projects directory in Unix environments.
What likely happened is xampp has certain permissions that don't play nice with what you need in Laravel.
I have a whole project with database, everything is working here.
Project with database
I would like to run website so I can see changes I have made.
Im using XAMPP. My configs for VirtualHost hosts and http-vghosts.conf
I have tried this https://youtu.be/iXYCnYRalaw?t=2m13s ->> from [2:13] to [4:22]
using XAMPP, but still cant run it.
Can you give me any advice or steps how to make website run on my PC? [ofcourse just for me (VirtualHost)].
Editor using: Atom
My PC spec
If running laravel appliation inside XAMPP htdocs folder is really necessary, then could you provide some kind of error, simply telling "it doesn't work" doesn't help at all.
One thing you can try is to open command prompt inside laravel folder and run
php artisan serve
This will open local server that runs current project in:
http://127.0.0.1:8000
Also, checking laravel minimum requirements is something you should check out. 5.5 requires PHP 7 and you didnt tell what XAMPP version you are running.
I am now developing a PHP website using Laravel 5 framework. I published the website through Git clone to the server. However, after visiting the URL, the website only shows its structures, which is shown as: http://mikemikezhu.me/laravel/laravel_trial/
The index.php in the public folder cannot be parsed, and only the folder structure is displayed. My server is running Centos 7 system. The web server is Apache and the PHP version is 5.4.16. I am wondering whether it is because the PHP version is too old to run the Laravel. Or is there any other ways to publish the website correctly? I am not going to use Forge and Envoyer bacause they are not free of charge.
Check if you have the correct PHP version for your application with the command:
php -v
If you are using Laravel 5.0 you need PHP >= 5.4, PHP < 7
If you are using Laravel 5.1 you need PHP >= 5.5.9
If you are using Laravel 5.2 you need PHP >= 5.5.9
If you are deploying the app with Git, check if the folder permissions are correct and compatible with the Apache user.
Firstly make sure the whole directory structure including files is owned by the apache user - using the chown command.
you'll want to point your vhost to the public folder, not the project route
https://laravel.com/docs/5.0/errors shows you how to enable debug and logging - great for seeing why it might not be working
I'd update to at least PHP 5.6 as #amieiro mentions
I am imported my Project trough git, the project is a php project running on symfoy2.
However it seems that intelliJ does not recognize it as a php project and therefore only shows a bunch of files (static web files such as .js, images, ... )
I was wondering if there is a fix for this, i did the following already:
- Installed php, symfony2 modules
- I am running IntelliJ Ultimate
I removed the existing modules (in project structure settings) and added the web module, that fixed my issue
I have this problem getting my newly created php project on Netbeans work on Ubuntu.
I've tried to place the source folder of the project in the /lampp/htdocs folder or selected the copy location option on the 3rd step of creating the project, yet none of them worked.
Here the version of the softwares I'm using:
Netbeans 7.1
LAMPP (newly download)
Ubuntu 11.10 (up-to-date)
I would be thankful if steps can be provided.
Ok I'll give you everything I usually do From the moment I download a new version of Ubuntu.
After installing Ubuntu I download XAMPP for Linux and follow their installation guide. Pay extra care to the permission when extracting XAMPP. Be sure you extracted it in the correct folder /opt.
You must start XAMPP manually by using the command /opt/lampp/lampp start. You will need root access for that. If everthing was started normally you will get the following message in the terminal:
Starting XAMPP 1.7.7...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.
Navigate to http://localhost or http://127.0.0.1 you should see the following screen.
(source: techblissonline.com)
Select your favorite language then voila your installation is complete.
create a new Netbeans project and call it test for example inside /opt/lampp/htdocs/.
Create an index.php file inside /opt/lampp/htdocs/test/ and put echo phpinfo() inside it.
Navigate to http://localhost/test/index.php and you should get the page you just wrote.
Notes:
Make sure all php extensions that you need are already installed by checking the phpinfo() page in XAMPP.
You would probably want to start XAMPP each time you start your PC instead of doing it manually every time. There are several ways to do that if you google it.
Have you tried all these steps and still can't get your project running ?