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!
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 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 .
Just got on a Windows 10 and after I configured my php.ini and http.conf I went on the command line httpd.exe and got this error message:
httpd.exe: Syntax error on line 530 of C:/Apache/conf/httpd.conf: Cannot load C:/php/php7apache2_4.dll into server: The specified module could not be found.
I KNOW this file is in that folder. I've installed both 64 bits version of PHP and Apache and I don't know what's going on.
Check whether you have installed Thread safe version of PHP. Non Thread safe version will cause this error.
You can download thread safe version of PHP here
while you downloading PHP u should select ThreadSafe pack, Apache not supporting nonThreadSafe...
As the others said, the NON Thread safe (nts) does not support apache and u have to install thread safe versions
Which VC compiled version of Apache do you use?
On php.net they recommend to use the apache server from apachelounge.com combined with the threadsafe php files.
Also make sure that you have installed the C++ Redistributable Visual Studio 2015.
If it still fails with that error make sure the user who is starting the process has access to the filesystem.
I was able to overcome this error by uninstalling my previous version of wampserver , then installing the latest version (3.2.0), closer to the php7.4.9 target.
As I previous had php 7.2 with an earlier version of wampserver (can't remember which), none of the above tricks would work for me. I was still getting the error of this topic title. Now working ok.
Reminder: to integrate an external version of php into wamp, rename php.ini-development in folder php7.4.9 into phpForApache.ini
I'm not sure if this is the same problem, but I had an issue that the Apache httpd service would not start when I tried to add the php module to an apache server (httpd.conf). The service would not start. When I looked at the Event Viewer I found an application error event indicating that the service terminate unexpectedly, and it indicated that the problem occurred in Apache24\bin\libapr-1.dll.
The problem was with the LoadModule statement that I added at the end of my httpd.conf file. Here's what I orginally had:
LoadModule php7_module "C:\PHP7\php7apache2_4.dll"
Here's what I changed it to:
LoadModule php7_module C:\PHP7\php7apache2_4.dll
Low and behold, the apache service started, any I was able to execute the phpinfo.php sample script that I added to the Root Document directory. (By the way, forward or backward slashes both work.)
The difference is that I removed the quotes. The quotes were there because I had just copied and pasted from a web page that said how to install PHP.
I had a similar issue and when i looked in the apache24 error log it said something about PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown etc. I had installed a version of vcredist but obviously it needed a more upto date version and found solution here: vcruntime140.dll 14.0 not compatible with PHP build
I am working to build a small email client inside a web application. After doing some research I attempted to use the imap function. I got an error saying I was calling an undefined function, so again I researched and uncommented extension=php_imap.dll.
I then found I had to update php with the imap function and I did so. Now, the imap functions works in php interactive inside Terminal, but I can't get it to work in the browser. I'm assuming I have to somehow load it in the Apache Config files but I can't seem to find how to do so.
Any Ideas?
You'll need to restart Apache to reload the PHP module with the new configuration. The command line PHP starts a new PHP instance each time with the latest configuration, whereas the PHP extension running in Apache is separate, and only loads new configuration setting when Apache itself is restarted.
Assuming you're running on Windows based on the .dll extension, so apachectl restart or apache2ctl restart may work, or the installer you used may have a tray app or other GUI tool that can do it for you.
If running on Linux sudo service apache2 restart or sudo service httpd restart depending on distribution.
I know this is my fault. What I did was upgrade my php 5.3 to the latest php5.5. But due to some important reason I need to roll back to my previous php version which is 5.3.10. Upgrading to the latest php5 gave me no sweat but when I roll back it gave me this error:
$ sudo service apache2 start
* Starting web server apache2 apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/access_compat.load:
Cannot load /usr/lib/apache2/modules/mod_access_compat.so into server: /usr/lib/apache2/modules/mod_access_compat.so: cannot open shared object file: No such file or directory
Action 'start' failed.
The Apache error log may have more information.
Please help anyone.
Comment line 2 in /etc/apache2/mods-enabled/access_compat.load and all other include problems, 3 for me
I had this problem when downgraded apache from 2.4 to 2.2, so i had to disable the modules there enabled in the 2.4 installation.
a2dismod <module-name>