I have a WAMP Server installed in Win2012 Serv , PHP 7.1.9 and Apache 2.4.29. The PHP drivers for SQL Server (php_sqlsrv_71_ts.dll etc) work perfectly - but if I switch the Apache server to use FastCGI then the SQL Server drivers stop working, flip back to non Fastcgi - everything fine. I need to switch to Fastcgi because the HTTPD service in apache 2.4.25 and above crashes and restarts over and over and over , sometimes 30 times a day , but in fastCGI mode its solid and stable.
What am I doing wrong ? is there something to add to Fastcgi config to use SQLSRV drivers ? The error is the usual - unknown function sql_srv_query() , indicating that the SQLSRV drivers are dead or not there....
I resolved my issue - turns out that the phpinidir directive in wamp needs to be the apache\apache2.4.29\bin and not the php directory. When changing to use fastcgi make sure to reference the Apache php.ini sym link in the config options .
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 had a server there is apache, php and oracle the configuration is complete from php.ini and path
but when i running script php in browser there always an error.
ci_pconnect(): OCIEnvNlsCreate() failed.
and then when i'm running in terminal it's works..
NB: in apache env is complete
LD_LIBRARY_PATH=/apps/oracle/client/client_1/lib
ORACLE_HOME=/apps/oracle/client/client_1
ORACLE_BASE=/apps/oracle
please help me fix this
You need to set the same environment variables so that Apache can access them, and make sure that the Apache process has directory permissions to read the Oracle libraries.
How you set the environment depends on your OS and version of Apache.
For example, on RHEL 6 or Oracle Linux 6 you would add these to /etc/sysconfig/httpd:
export LD_LIBRARY_PATH=/apps/oracle/client/client_1/lib
export ORACLE_HOME=/apps/oracle/client/client_1
export ORACLE_BASE=/apps/oracle
On RHEL 7 or Oracle Linux 7 you would add these to /etc/sysconfig/httpd:
LD_LIBRARY_PATH=/apps/oracle/client/client_1/lib
ORACLE_HOME=/apps/oracle/client/client_1
ORACLE_BASE=/apps/oracle
There are some other hints on p77 of http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html
I have the SQLAnywhere PHP extension installed and it's working fine, right up until Apache restarts.
After Apache has restarted, any attempt to access any website on the server generates the following error in the Apache error log and throws a 500 internal server error on the page:
AH01215: PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php56
To resolve it, I can explicitly stop and start Apache, but restarting Apache (apachectl restart) doesn't.
This is generally fine until an automated process (such as a cPanel update) causes Apache to restart.
The SQLAnywhere PHP extension was configured as follows:
Install the SQLAnywhere client
Download the PHP extension to the extensions directory
Add LD_LIBRARY_PATH=[sqlanywhere/lib64] to /etc/environment
Log out and back in for the LD_LIBRARY_PATH to take effect
Add the extension to the php.ini (or sqlanywhere.ini in php.d folder)
Stop then start Apache
My current thinking for a workaround is to modify the cPanel update script to perform an Apache restart by explicitly doing a stop then a start as this would cover the immediate issue, but I'm hoping that somebody might know of an actual fix for this to avoid any other automated restarts causing problems.
The stack I'm running is:
CentOS Linux release 7.3.1611 (Core)
cPanel 60.0 (build 28)
Apache/2.4.23 (cPanel)
PHP 5.6 (using cPanel's MultiPHP and EasyApache4)
SQLAnywhere12 Client
Thanks in advance for any suggestions!
I'm on Windows 7 and I have installed Apache 2.2, PHP 5 (latest stable build) and MySQL.
I have configured PHP 5 with Apache 2.2 as a module (i.e. LoadModule and AddType statements added in httpd.conf).
Everything seems to work when I start Apache from the console (command prompt) but PHP would not work when the Apache service is started. In this configuration, the localhost/index.php ends up getting downloaded in the browser. Why is that?
My guess is that the Apache Service loads up its own version httpd.conf file. Anybody faced similar problems?
DO note:
- I know of XAMPP, WAMP etc and I don't want to use them
- I don't want to use PHP as CGI
I finally switched to XAMPP. But I feel this has to do with some of the default security settings in Windows 7. WinXP gives me no problem.
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