No input file Specified. Laravel 5.5 CentOs - php

Hie, I am trying to host a Laravel project on a VPS server with Cpanel. I am getting the No input file Specified error when I access the site.
Things I did so far>
Got Managed VPS hosting from inmotionhosting.
Got into root and downloaded the laravel project on var/www/html.
Got a domain name point at the server's Ip address using A.
Changed the virtual host file servername and alias to the domain name keeping the ip address on the top as shown below:
<VirtualHost ipaddress:80>
ServerName mydomain.com
ServerAlias www.domain.com
DocumentRoot var/www/html/laravel/public
</virtualhost>
Now when I access the domain it returns No input file Specified error. I am not sure how to change the .htaccess to get this working, I believe it is something to do with the server .htaccess. I did fiddle around for quite a bit but a no vain so I had to turn to stackoverflow.
Adittionaly I changed my html folder permission and ownership to apache, tested with 755 777, tested with different user name no luck.
Not using vagrant or homestead or forge , Any suggestions

I had a similar issue. While I also edited the Apache configuration and it didn't work, since for me it was PHP-FPM.
For some reason the document root was not changed in /opt/cpanel/ea-php72/root/etc/php-fpm.d/{my-domain-name-here}.conf.
Correcting the document root here is what did the trick. So if you have a PHP-FPM configuration.
Check the document root specified there as well and then restart the FPM service.
You might run this command to restart FPM service:
/scripts/restartsrv_apache_php_fpm

Also don't forget to restart php-fpm service after changing document root,.
In my using in my case was:
systemctl restart ea-php72-php-fpm.service

Related

localhost loading wrong css files

I have a custom website in Magento 1.9 running on my localhost, its Ubuntu 18. LTS , running on a php 5.6 and apache, everything works fine, but not the css
This is the url is loading:
http://local.mysite.com/var/www/html/mysite/skin/frontend/base/default/css/files.css
So as you can see it loads /var/www/html witch is wrong, this is my virtual hosts inside apache2 folder sites-available:
local.mysite.com.conf
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin webmaster#domain1.com
ServerName local.mysite.com
ServerAlias local.mysite.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php
DocumentRoot /var/www/html/mysite
# Custom log file locations
LogLevel warn
ErrorLog /var/log/apache2/error-mysite.com.log
CustomLog /var/log/apache2/access-mysite.com.log combined
</VirtualHost>
Just for the record i have enabled mod rewrite
sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2
Guys you can try this to solve the problem. I also faced the same problem it helped me
i redid all the steps that i have done before, like getting all the files from svn, re-importing the database, and changing the web/unsecure/base_url & web/secure/base_url, configuring apache virtual hosts etc..
but i think what solved the problem was changing the ownership of media and var directories to www-data instead of user and giving those folders full permissions.
I have done this step because in the main server, the those directories were owned by www-data user..
Also, i observed that the css was loading from zz.com/media/css folder, which was automatically created once the media directory was setup properly, which did not happen earlier, the directory has css files like 0a039da6028e6d636132ecd5e235f417.css etc..
the request url was something like this (from net window in firebug)...
http://zz.com/media/css/0a039da6028e6d636132ecd5e235f417.css
and not like the one i mentioned how it should be above (http://zz.com/skin/frontend/default/jm_wall/css/layout.css), nor like how the request was sent (http://zz.com/var/www/zz.com/skin/frontend/default/jm_wall/css/layout.css)
Hope this helps someone else...

VirtualBox Ubuntu server guest: serving of symfony app ends up with: attempt denied by server configuration

I'm running Ubuntu Server using VirtualBox to develop symfony app. I've set up shared folder, changed apache default folder /var/www/html to /media/sf_apache_shared which is shared folder, for convenient development.
The default apache's index.html file, denoting that apache is set up correctly, works fine. The problematic moment comes into play, once I try to run symfony app.
If I try to create default symfony app, I get the following result:
Although I can create symfony app using the same way, but outside of that folder, for example inside of /var/www/html.
I've checked the permission of sf_apache_shared folder with the result of 770, using the following command:
stat -c %a directory
But even aside of that fact, I manually copied symfony app project to sf_apache_shared and tried to access that project, from windows host, using chrome. The result apache's logs are:
client denied by server configuration: /media/sf_apache_shared/my_project_name/app/
client denied by server configuration: /media/sf_apache_shared/my_project_name/src/
Here is my server configuration:
i´m not too sure if this will be a final fix for your problem
but you definetly have to set the DocumentRoot and Directory in you conf
to /media/sf_apache_shared/web
ins symfony app the /web folder is designed to be the document root
also you should set ServerName and access your server via the hostname
and try Allow from All
example.
<VirtualHost *:80>
ServerName hostname.com
DocumentRoot "/media/sf_apache_shared/web"
<Directory "/media/sf_apache_shared/web">
Options Indexes FollowSymLinks
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
also check/compare the owners of the folder (ls -lrta)

Run laravel 5 app without php artisan serve

I have created small blog application in laravel 5.2 .the app works whenever i run it using php artisan serve.
But without running artisan serve , when i access it from public folder for e.g. localhost/blog/public/addBlog it gives error page not found.
My routes.php has following lines
Route::get('addBlog','BlogsController');
It works fine with php artisan serve with visiting http://localhost:8000/addBlog
The solution is pretty simple. Laravel expects your public folder to be the root of the webserver / url / domain.
Using the serve command works since localhost:8000 is the root then.
Using the longer url doesn't work since your root is localhost/blog not localhost.
A fairly simple solution is to create a virtualhost, to explain how you can do this we would need to know what is running on your localhost (xampp? wamp?)
Nevertheless, the solution would be a virtualhost pointing to localhost/blog/public
Update
example for wamp virtual hosts
C:\Windows\System32\drivers\etc\hosts => open as admin and add
127.0.0.1 blog.dev
C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
ServerName blog.dev
DocumentRoot "C:\wamp\www\blog\public"
ServerAlias blog.dev
</VirtualHost>
It's basically the same for xampp, but the path to the vhosts conf is different
Don't forget to restart wamp/xampp after doing the changes. Then simply open http://blog.dev via browser and enjoy
Laravel expects the folder to be in the root of the application so set-up a virtual host and update your hosts file to match.
Use following command
sudo a2enmod rewrite
I had tried in to the ubuntu but i am not sure that will run in another os or not

Post request not working Drupal and Ubuntu 14.04

In my ubuntu 14.04 OS machine for drupal 7 login not working, may be it is not only login but all post request not working here. For the same filesystem and codebase it works fine in windows 7 machine.
Here is my apache server configuration:
<VirtualHost *:80>
ServerName somedomain.local
DocumentRoot "/home/mycompany/Development/Projects/Drupal/cbb"
<Directory "/home/mycompany/Development/Projects/Drupal/cbb/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
for above configuration when i try to submit data for login it showing..
"NetworkError: 404 Not Found - http://somedomain.local/user".
#UPDATE:
I just find out that login not working only from www.domainname.local/user path but if this login form in homepage sidebar it works fine, for all of drupal sire in ubuntu machine. With this no error message also not display.
I am in trouble for two of my drupal site in Ubuntu machine. Any help will be appreciated.
Check if .htaccess file present in drupal root directory.
Check if you've added your domain to /etc/hosts file
127.0.0.1 domain.name
Domains with 'www' and without it are totally different. Add both to /etc/hosts and to apache's config file to avoid problems.
Clear cache to avoid previous domain name which could be stored in cache.
drush cc all
If you've just added new site to apache's configuration be sure to run:
sudo service apache2 graceful
Your Apache vhost file looks like it has the key components set and I'm assuming that the .htaccess file exists in your document root and hasn't been modified from the Drupal default.
When you click on the login link in the sidebar, does it take you to http://somedomain.local?q=user/login ?
Your #update suggests that even though your Apache environment may be set up for "clean URLs", the feature is not enabled in Drupal at Administer > Configuration > Search and metadata > Clean URLs.
If modifying this compromises your access to Drupal, you can apply/disable this change via Drush (drush vset clean_url 0 --yes) or directly through MySQL (UPDATE variable SET value = 's:1:"0";' WHERE name = 'clean_url';) as per https://www.drupal.org/node/5590.
Also worth mentioning, seeing it on this related question (Very strange Drupal 7 404 behaviour): make sure that Apache modules mod_rewrite and mod_headers are enabled:
sudo a2enmod rewrite
sudo service apache2 restart

OS X (10.9.1) localhost 403 Forbidden you don't have permission to access / on this server

I have just started using laravel and a mac to develop websites. I have gone through the setup and tried following a phpacademy tutorial.
My problem is that when i try and access the localhost, as default i get the index page where all my folders are stored and when i enter my direct path e.g. laravelpractice.local in the web browser i get the error that i mentioned in the title.
i have edited the /etc/apache2/httpd.conf and the /etc/hosts to create a virtual host and create a custom url respectively and the spelling seems to be fine.
/etc/hosts file open. You must be the owner of the file.
127.0.0.1 localhost.localdomain localhost
after add
127.0.0.1 laravelpractice.local
000-default.config file save. After /etc/apache2/sites-enabled/000-default.config file open. You must be the owner of the file. Add to the bottom
<VirtualHost *:80>
DocumentRoot "/var/www/laravelpractice/public/"
ServerName laravelpractice.local
</VirtualHost>
Apache restart with terminal:
sudo service apache2 restart
Open browser and url : laravelpractice.local

Categories