I've configured PHP5, Apache2 in a debian machine. And the PostgreSQL server is in a different machine. ODBC connection is successful when i use this command in the terminal isql -v [database name] and i even can execute the queries successfully. But the challenge is when I open the PHP files through Chrome i'm getting the error like the one in the snapshot below [Web Console].
I've configured the ODBC in my local Windows Machine and I can see the result of the same PHP file when executed through my Local WAMP Server but i get the error when i try to open it through the Linux machine.
Somebody please help me on this.
How is your PHP configured? suPHP, FastCGI, CGI or DSO? You should also be able to take a look at the error logs for Apache:
tail -n 200 /usr/local/apache/logs/error_log
That will list the last 200 lines. You need to be looking for the 500 error. I suspect it's due to permissions, so you may also want to check out the suexec log:
tail -n 200 /usr/local/apache/logs/suexec_log
Related
After I install php 8.0 on my webserver running apache 2.4.53 on ubuntu 20.04, my haproxy config on a pfsense router says the webserver is down. Even though apache is running fine.
I know its the main cause because after I uninstall php 8.0 the webserver is up and accessible according to haproxy.
The problem is, that I can't load content without having php installed on the webserver, but if I have it installed, the webserver isn't accessible from the designated ip.
I have tried reading the haproxy error log, but I can't find it. Also tried to reinstall the haproxy config but this also didn't work. In haproxy status overiew it also gives the error: Layer 7 wrong status: internal server error, googling this didn't give much results.
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 am trying to run a PHP Script on my apache server installed with xampp under Linux but seem to have some user/file permissions issue. I have installed php cli and the path name is all correct.
My command is this and it does not do anything.
/usr/bin/php /home/eem/website/cron/cronjob_test.php
When I run it as wget or curl instead of php it executes correct. I know that curl+wget run with the apache user and php cli runs with the cron user.
So the fact that php does not execute should have something to do with the apache configuration in xampp or some user permissions but I really have no idea what the problem is.
Any help will be appreciated!
PHP 5.2.5
Microsoft IIS 6.0
Windows Server 2003 R2
I have just enabled php_printer.dll in my php.ini file, and it works correctly from the command line. However, running the same commands within a script running on IIS gives me a "call to undefined function printer_open() ...". My boss says we shouldn't have to restart IIS to get it to work, and is unwilling to try, because of the few mission-critical apps we have running on that server. Is restarting IIS necessary, or should the commands be accessible from a script as well as from the command line?
I suggest you ask on serverfault whether a IIS Process Recycling is advisable to reload php/isapi.
I have installed XAMPP on a Windows XP Machine. PHP scripts are working fine through the browser.
Initially, PHP.exe (CLI) was failing with error - can't load php_pgsql.dll
I disabled extension=php_pgsql.dll in the php.ini file and PHP.exe stopped to fail.
However, even now I am not able to run a PHP script from the CLI even though the same script runs fine through the browser.
The script fails at mysqli_connect() with error - Can't connect to MySQL server on '127.0.0.1'
Has somebody else faced the same problem?
Kshitij
Did you start the MySQL service via the XAMPP Control panel and it kept beeing marked as "Running" in both test cases?
Did you test the webserver version by requesting something like http://localhost/... or http://127.0.0.1/... and did you run the php.exe -f something.php test on the same machine?
How many php.ini have you got? It's likely the CLI version has a different php.ini than the web version.
Is the path to your mysql DLLs in your command session's PATH environment variable? You probably need to add \pathtomysql\bin to your path. On my machine it is:
C:\Program Files\MySQL\MySQL Server 5.0\bin