apache/2.4.29 (ubuntu) server at localhost port 80 - php

I am trying to run openEMR project in Eclipse on my Ubuntu 18.04 machine. I have downloaded the project and installed the dependencies using below command.
composer install --no-dev
npm install
npm run build
composer dump-autoload -o
I followed this tutorial to run the application but still I got the below error.
The project is present inside this folder.
And the configurations in Eclipse are:
I tried like below as well:
What am I missing here?

You are accessing a resource in your web browser which does not exist in your apache2.
The directory public_html is your Document Root. Therefore, you have to specify a resource that is relative to your Document Root.
Try
http://localhost/openemr-6_0_0/index.php

Related

How to use a specific version of composer?

I am using a shared host which comes with an old version of composer. Unfortunately, it's an old version its not able to install something properly. My shared host provider said I can simply install a new version to my shared root directory.
So I did that by adding a php.ini file and then running the following command
php -r "readfile('https://getcomposer.org/installer');" | php -c php.ini
That seemed to work and when I run the command to check the version it only shows me the new version when I run php composer.phar -V. But when I run composer -V, it shows me the old version.
How can I override the main composer for my shared directory? And by the way, I did this in my root directory as I have multiple domains so was hoping I could get this to work in all domains.
I managed to find a solution. I just needed to create an alias and it seems to be working now
echo alias composer="composer.phar" >> .bashrc

yii2 not installing with correct permissions with composer

I am running windows 10 with the ubuntu subsystem installed as my localhost. I have composer installed on that and when I try to install the yii2 basic application it goes through the process correctly but when i open the yii2 basic application in my browser I get:
Failed to change permissions for directory "/mnt/c/Users/andre/zype/staff-tools/web/assets/89851207": chmod(): Operation not permitted
If I then change permissions on the yii2 installation file structure with
sudo chown -R www-data:www-data .
the application loads but the web/assets folders are missing so my application has no styling. I am unsure if this is a composer issue or a yii2 issue but it looks like permissions to me.
Try changing the permission of 'assets' folder most likely to 777 (all users can access this file)
your-project/web/assets
Well this solution works for Linux users. Will require to check for windows
Follow Steps
Step 1- Install Composer (I installed it through bash)
Step 2- Now in cmd use following command
composer create-project --prefer-dist yiisoft/yii2-app-basic yii2-basic-check
Output (Last Lines)-
chmod('runtime', 0777)...done.
chmod('web/assets', 0777)...done.
chmod('yii', 0755)...done.
Step 3 - Open "http://localhost/yii2-basic-check/web/" URL in browser.
It worked fine for me
Important: Windows Subsystem for Linux has many serious problems with file permission. So, I advise not to install Linux programs and it's files in Windows drives i.e. DRVFS (/mnt/c). Also as PHP frameworks need many files, it will be better if you install distributions in another internal NTFS drives other that C:\ drive.
Steps: Place/clone the required project files/repositories in current user's home folder e.g. /root, /home, /home/user. Do not place the files in C:\ drive aka. /mnt/c otherwise WSL will not follow their permissions correctly. Here is an example of the installation procedure from YiiFramework: The Definitive Guide to Yii 2.0.
Install required packages: sudo apt-get install php php-cli php-common php-mbstring php-xml php-zip zip unzip
Go to user folder: cd ~
Download composer: curl -sS https://getcomposer.org/installer | php
Install yii2-basic: ~/composer.phar create-project --prefer-dist yiisoft/yii2-app-basic basic
Go to project folder: cd ~/basic
Run PHP server: php yii serve
Open server in browser at localhost:8080 (default port 8080).

Laravel - Installing packages that were installed with composer on live server

I have a laravel project on namecheap shared server, I have set up everything and it is working there. But after that, I have added locally on my machine to the project imagecache intervention package with composer. I don't know how to install it on the server though, I have tried with running composer commands through ssh:
php composer require intervention/imagecache
But I got an error:
Could not open input file: composer
Since, their support told me that they actually have composer uploaded in the folder public_html and not where my project is and that is public_html/myProject if that is the problem. Since I have no idea, how the composer is installed and setup there, I wonder how can I install this package. I have also tried by just uploading the whole directory of the package from my local vendor folder in the project to the production server, but that didn't work either, images were still not visible when I was using imagecache route. How can I fix that?
Run this: php -c php.ini composer.phar install
First You have to create php.ini file with this info.
max_execution_time = 300
max_input_time = 300
memory_limit = 512M
suhosin.executor.include.whitelist = phar
detect_unicode = Off
If you have ssh then you can create a folder where ever you wan't.
It is better if you put it in the same level that your public folder and then install composer inside this folder:
with curl
curl -sS https://getcomposer.org/installer | php
if you don't have curl or the server has restrictions you can use:
php -r "readfile('https://getcomposer.org/installer');" | php
or you can "Manual Download" the composer.phar and upload it trough ftp
https://getcomposer.org/download/
Then you need to give execution rights to the composer.phar file and you
chmod a+x composer.phar
can also create an alias to run composer from your public folder
alias composer="path/to/composer/composer.phar"
This alias will work until you close your console. In some shared servers you will see a file call: .bashrc where you can put the alias

Homestead: command not found- Windows 10 - Tried everything

Receiving bash Homestead command not found
//After running composer global require "laravel/homestead=~2.0"
Changed current directory to C:/Users/Eric/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
//Inside my vi ~/.zshrc
export PATH=/Users/eric/AppData/Roaming/composer/vendor/bin:$PATH
export PATH="$laravel:$PATH"
I enabled Virtualization in BIOS
// Inside etc/hosts
Hosts:
127.0.0.1 homestead.app
192.168.10.10 homestead.app
//Inside environmental variables
C:\Users\Eric\AppData\Roaming\composer\vendor\bin
I can't find the homestead.yaml folder and I can't run any homestead commands. Any help with this would be appreciated, thanks!
Assuming that you already have VirtualBox, Vagrant, Git Bash (Git for Windows) installed and working you have two options to install Homestead
Using Git Bash:
Open git bash, navigate to home directory (typically it's C:\Users\{username}) and run
git clone https://github.com/laravel/homestead.git Homestead.
This will download Homestead in C:\Users\{username}\Homestead directory.
Then go to the Homestead installation directory
cd ~/Homestead and run bash init.sh.
This last command will create the Homestead configuration file (homestead.yaml).
Using composer
You need to have PHP and Composer already installed.
Open git bash and run composer global require "laravel/homestead=~2.0" command.
To take advantage of the Homestead CLI, make sure to add the Composer /bin directory to your PATH e.g. command prompt with admin privileges:
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
Then to create the Homestead configuration file (homestead.yaml) you have to run homestead init.
If none of the above don't work you can use Laragon http://laragon.org/.

Blank page with php artisan serve for laravel 5 in mamp php 5.4.10

I am trying to install Laravel for first time. I installed it on my desktop with the following composer command
composer create-project laravel/laravel laravel-app
The command completed successfully without any error but with some messages like
symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/translation suggests installing symfony/config ()
I now did chmod -R 777 larvel-app to make whole folder writable by everyone. I now started php server with following command
cd laravel-app
php artisan serve
and it gave following message
Laravel development server started on http://localhost:8000
When viewed from web browser in address http://localhost:8000, there is nothing, only blank page. When I browse this address, the server seems to quit.
I have following environment:
OSX Mavericks;
MAMP with php 5.4.10 and apache2;
following extensions in php.ini file
extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so
;;;;;Following are added by me ;;;;no error when starting server
extension=openssl.so
extension=mbstring.so
When I run which php from command line, I get following.
/Applications/MAMP/bin/php/php5.4.10/bin/php
When I tried to run this in mamp ie localhost:8888, it gave 500 internal server error.
Please suggest me, where I might have made mistake.
As a OSX user i strongly recommend you to use Laravel Homestead to develop your applications.
http://laravel.com/docs/5.0/homestead
You only need to install:
Virtualbox
Vagrant
I have my projects in ~/code folder, so everytime i create a new project, i just:
Add project test domain to my local host file (my-project.app pointing to localhost 127.0.0.1)
ssh into the homestead virtualmachine (homestead ssh)
run built in serve command (serve my-project.app /path/to/project/public)
VoilĂ 
The most common reason for this is that the web server process does not have write access to the storage folder and its subfolders.
Set the permissions on the storage folder so that the web server can create files.
You don't have to use php serve, mamp does that for you. Make sure you point your directory to public folder. You can also use custom domain for each of your projects.
Also for Mac there is laravel valet. Easy to get started with many php projects.
I think you should move your Laravel Application to
/Applications/MAMP/htdocs/
and then you can access it on
http://localhost:8888/laravel-app

Categories