I have a project that it is deploy and running on Debian (apache 2.2.9, php5.2, mysql 5.0)
Now i trying to run it in ubuntu 11.10(apache 2.2 php 5.3 mysql 5.1) but only the homepage is working.
If i click on any of the links I get the Not Found page:
Not Found
The requested URL /patients was not found on this server.
Does anybody have an idea why it is doing this?
I basically check everything, I can't figure out why.
I have a feeling it has to do with cakephp.
You need to enable mod_rewrite in Apache.
Run this command in terminal: sudo a2enmod rewrite, another I had to do for a fresh install was sudo a2enmod headers. Afterwards, you'll need to restart Apache, the terminal will tell you what command you have to run to do that.
Related
I have an Ubuntu VM / Azure SQL DB combo where I have two sets of PHP files.
1) Some scripts that run from CRON jobs
2) A Yii2 Framework website
Both environments connect to an SQL Server database.
I have done all the steps to compile sqlsrv and added it to PHP's list of extensions. My scripts work great from the terminal, but on the website, I get an error:
could not find driver
My webserver is nginx, and it runs the website properly, but PDO does not connect to SQL Server.
I only have one PHP installation, but nevertheless used code to determine which is the right php.ini file in use and it has the right extensions directive.
A phpinfo() output also shows sqlsrv in the 'Registered PHP Streams' section.
My UFW firewall is inactive and I don't have SUSELinux. Nevertheless ports 22 and 80 are open. Even tried enabling it.
I am not sure what else to try. Help!
EDIT
I created a simple test file. When I run that through the terminal, it works, but when I do so via a browser, it doesn't.
EDIT 2
I installed Apache2 instead of nginx, and everything works now.
I think you need to try with just some "Hello world". If this not help type in terminal:
sudo apt-get install php-mysql
And restart your nginx server with:
sudo killall nginx && /usr/local/nginx/sbin/nginx
I've recentlly got a problem with my local virtual hosts after installing php 5.6 next to php 7.0. I'm using Ubuntu 16.04 with Apache, MySQL etc. configured for Laravel projects and everything was working perfectly fine with php 7.0 until I had to work with another project. This non-laravel project required php 5.6 to work, so I installed it next to php 7.0 together with some modules for phpmyadmin (as it didn't work after I switched server to php 5.6). So what I did after installing php 5.6 was:
sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
Added a new host for my php 5.6 project in /etc/hosts as 127.0.0.1 www.myhost.local.
Added a new config in sites-available, enabled it, restarted the server.
Installed few required by phpmyadmin modules to configure database for the new project.
Worked with my php 5.6 project.
When I wanted to switch back to my Laravel projects I made:
sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
And none of the laravel hosts worked. The error I get from Google Chrome is:
This site can’t be reached
www.myhost.local’s server IP address could not be found.
ERR_NAME_NOT_RESOLVED
And I DIDN'T CHANGE configs of Laravel projects! I didn't edit neither sites-availavle configs, nor etc/hotst except for adding the line with my php 5.6 project. I've tryed:
Checking /etc/apache2/mods-enabled where are php7.0.load and php7.0.conf enabled.
Checking service apache2 status and got Apache active (running).
Checking http://localhost/ and got the default apache page.
Checking http://localhost/php.info which showed me that server is running with php 7.0
Deleting php 5.6 host from etc/hosts and disabling same config in sites-available.
Adding < VirtualHost 127.0.0.1:80 > instead of < VirtualHost *:80 > in the beginning of my Laravel host config. Which made some inner pages work if loaded without www and home page still didn't and www was added to url every time I tryed to load it. However some inner pages began later to generate www too and nothing helped :(
Checking apache logs and got warnings only.
Some other minor things I can't remember now...
Can anyone help please? Or is it easier to reinstall php completely?
Thanks everyone! That was browser cache (although I've checked other browsers I never opened my projects in). So it finally worked in incognito window and after I cleared Chrome's and FF's cache.
I'm trying to setup Valet to use with my Laravel projects, but ran into the problem mentioned in the title. The current version of Valet I'm running is 2.0.3.
So far this is what I've tried:
Reinstalled valet + restart
Reinstalled php7.0 --with-fpm
Restarted nginx
Updated composer global
Installed and ran mysql through brew
Installed and started dnsmasq
Restarted all services + started all services via Brew
Parked valet in different folders, but getting the same 'it works!'
I've looked at other people with the same problem, but they seem to run Valet 1.*. The solutions for them does not work for me. I don't get any error messages, and pinging foo.dev work as you would expect.
Really appreciate any feedback which can help me resolve this problem.
Check apachectl status. Stop apachectl using sudo apachectl stop.
Then run:
valet install
After run:
valet restart
I had a different problem where i stopped nginx and then started it manualy, "it works" now. lol
sudo nginx -s stop
sudo nginx
Before upgrading to this version you should run the following commands to stop and uninstall the existing Caddy daemon as they have said in the documentation:
valet stop
valet uninstall
and then
valet install
valet restart
I did not manage to fix the issue on the computer where the problem originated. However, I did manage to get it running on a clean macOS Sierra install, following the guide provided by the Laravel documentation.
Here are the steps I followed in order:
Installed Homebrew
Followed this guide to install php v7.1
Then followed this guide to both install and setup mysql
Installed Valet via composer
Ran the valet install command
This installed both nginx and dnsmasq
Ran the valet park in my workspace folder
I can now run example-project.dev in the browser and it will load the project just as the command php artisan serve.
Note: on the computer where the problem originated, both MAMP and XAMP were installed, but not currently running as I tested valet. There might have been config or installation clashes that made this not work as expected.
Hopefully this will help someone in the same situation.
I have a problem with apache2, wordpress and php.
I configured virtual hosts and copied the existing wordpress (installed in single host).
The web server is working fine and loads the index.php, but doesn't execute it.
Check mod-enabled folder in your apache. You must have two files their php5.load and php5.conf. If not present, its means php support is not their.To enable php support use command a2enmod php5
It is because your apache2 can't execute php.
In my case, I install libapache2-mod-php by:
aptitude install libapache2-mod-php7.0
Then restart apache by:
/etc/init.d/apache2 restart
May it help you.
when i try upload something on my domain ftp, blank screen appiers and automatic Zip download starts , even phpinfo not working. I have dedicated server and never had any problems
My domain is and i want to install script at http://fablefly.com/install
Can You look Guys ?
P.S i'm running Cpanel , php 5.2 , mysql , ion cube enabled.
I think I understand what you mean. I had the issue before when I set up my server and installed PHP, whenever I went to a page, it downloaded a useless file. I solved the issue by running the following commands via ssh.
sudo apt-get install libapache2-mod-php5
sudo a2enmod php5
sudo service apache2 restart
Not sure exactly how you would go about doing this via cpanel as I use webmin personally and do most of the work via command line. But I believe this is your issue.
See this page
http://serverkb.co.uk/wiki/PHP - the section titled "PHP Page downloading"
Check this out
http://cpanelhostingstuff.com/php-files-are-downloading-instead-of-executing/
Also look at some of these pages https://www.google.co.uk/#q=php+downloading+instead+of+executing+cpanel