Fatal error: Class 'COM' not found in E:\Server\wwwroot\PHPWebAdmin\initialize.php on line 13 - php

I am trying to set up hMailServer in "Windows Server 2008 Enterprise Edition Service Pack 1".I've setup hMailServer,Apache,PHP and webmail Interface "AfterLogic webMail" successfully.And all work well.But I am stuck in a problem while I tried to install "PHPWebAdmin"。
Error message as follows :
Fatal error: Class 'COM' not found in E:\Server\wwwroot\PHPWebAdmin\initialize.php on line 13
This infomation occurs while visiting "http://192.168.2.66:8088/PHPWebadmin/".
I've configured PHP configuration file php.ini options as follows:
[PHP]
register_globals = Off
display_errors = Off
doc_root = "E:/Server/wwwroot"
extension_dir = "E:/Server/php5_4_5/ext"
[Session]
session.save_path = "E:/Server/php5_4_5/tmp"
[COM]
com.allow_dcom = true
I've also finished these things as hMailServer manual suggests:
DCOM permissions
Overview
By default, IIS6 is not allowed to connect to hMailServer because of the Distributed COM permissions that Windows uses. Also, Apache run as a user account with restricted permissions is not allowed to connect by default.
Steps
Follow these steps to give IIS or Apache the required permissions to connect to hMailServer using DCOM.
1.Start DCOM config by selecting Start, Run, enter dcomcnfg.exe and press OK.
2.In the Component Services program, expand the Component Services folder
3.Expand down to Computers | My Computer | DCOM Config
4.Right-click on hMailServer and select properties
5.Select the Security tab
6.Under "Launch and Activation Permissions", select Customize and click on Edit
7.Under "Group or user names", click Add
8.For IIS6: add the built-in anonymous IIS user account
9.For Apache: add the Apache user account
10.Set the Local Launch and Local Activation permissions for this user to Allow
Actually,I even tried to give permission to EveryOne in the DCOM configuration.
Installing PHPWebAdmin is to give users a place to change their email password.
Enviroment here:Windows Server 2008,Apache2.2,PHP5.4.5.
Why this problem happen? And How to handle it?
Thanks a lot!

The php 5.4.5 build from windows.php.net ships the com/dotnet module as extension dll. If that's the case with your version of php too you can enable the module via
extension=php_com_dotnet.dll
in your php.ini

If you are using windows 8 and apache server and
extension=php_com_dotnet.dll did not work for you then:
copy php_com_dotnet.dll file to c:/windows/system32
and write to php.ini file:
extension = c:/windows/system32/php_com_dotnet.dll
I am using windows8 and apache server for windows.
Worked for me.
I hope this helped to you :))

For additonal clue to fix this issue I've noted that under IIS 10 / Windows Server 2016 I wasn't abble to make this interface working using a 32bits version of PHP 7.2 (FastCGI).
The solution was quite evident for me : running it with the 64 bit version of PHP 7.2 (in my case by creating a new application for the subdirectory "PHPWebadmin" and changing handler mapping as the main application needs to be run using a 32 bits version of php due to some spécific 32 bits developped extension).
Hope it may help,
Regards

Related

How to enable oci in xampp 5.6.3?

I am facing some issue while starting Apache server via XAMPP. I have installed XAMPP Version 5.6.3.
When I start the Apache server from xampp control panel, an error message is displayed as shown below:
On clicking 'OK' button, another dialog box is displayed as shown:
The thing is I wanted to use OCI instead of mysql. so I have commented out the mysql extensions and uncommented the OCI extension in php.ini file.
The php_oci8_12c.dll file is the only file available in the extensions (ext) folder of php in xampp. Hence I included the line in the php.ini as shown in the above image.
Since then I am getting this error.
I have installed instant client 12.1 as well but no luck. I also tried copying the OCI.dll from instantclient_12_1 and pasting it in c:/xampp/php and c:/xampp/apache/bin. The error still persists.
Need help..
UPDATE: I removed other oracle paths in PATH of environment variables, keeping only the instantclient path. Now I am getting this error..
Well, I've installed XAMPP 1.8.2, PHP 5.4 and Apache 2.0, and I use php_oci8_11g.dll and works fine.
You are trying use php_oci8_12g.dll, I recommend you read this link http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-12c-2088811.html with especifications for run oci12g.
I solved the issue after stuck 2-3 days .
Before follow steps Some things to remmember .
1- I am using win 8.1 64 bit .
2- Using Xampp 5.6.31 32 bit .
3- Using instaclient 12.2.0.1 64 bit (Because my win 8.1 is 64 Bit ) .
Now steps are below -
Step 1 - Download xampp 5.6.31 32 bit and install it .
Step 2 - Download and install oracle 11g R2
Step 3 - Download and install OTN (oracle instaclient 12.2.0.1 )
Extract all files in any drive in my case i have extract in C:\oracle\instaclient12.2.0.1
Add (C:\oracle\instaclient12.2.0.1 ) it to the path variables of the system. and also add new variable under variable of system with name TNS_ADMIN and put same path (C:\oracle\instaclient12.2.0.1 ) in its value .
Its time to set PHP.INI here uncomment following (see image below)
PHP.ini setup
Copy 3 files from C:\oracle\instaclient12.2.0.1 oci.dll,oraociei12.dll and oraons.dll to xampp apache\bin . by this step Unable to load dynamic library issue has been resolved .
Unable to load dynamic library issue solution
Now restart Apache on xampp and check info.php on browser . OCI8 module will appear there enable .
Enjoy !!!.
I solved the issue. The problem was that I was trying to use a 64 bit DLL(php_oci8_12g.dll) in a 32 bit PHP. I downloaded a 32 bit instantClient and it works now! :-)
instantclient-basic-nt-12.1.0.2.0.zip
I had a problem related to OCI8 and XAMPP for days in a row, the problem was shown as:
Fatal error: Call to undefined function oci_connect()
I was able to correct it using the php that comes by default with XAMPP. I'm using windows 10 64 bits as well, but used xampp-win32-7.3.2-0-VC15 (php 7.3.2). To summarize, I was able to get a correct configuration by doing everything with 32 bits versions (except the o.s). The full story and how I've done it:
If you go to your xampp/php directory through cmd, in my case it was "C:\xampp\php", and start the php by the simple command "php" it will probably show what dlls are not being found in the etc folder or which of those are not Win 32 compatible. If you get this problem, you will not be able to see the OCI8 page when opening a phpinfo() page:
If that's the case, with win 32 compatibility problems or not finding the dlls that you are certain are there, you should unistall XAMPP and reinstall it using a x32 version. The phpinfo page will show x86 Architecture. Remember to remove in the path variables any source that miss locate your php in use, the point here is to use the one given by default in XAMPP. If you need by any reason to use another php installation, remember to use x86 architecture.
If you need an updated OCI8 dll you can download it on https://pecl.php.net/package/oci8 , but remember to check the Thread Safety compatibility, you can find it on your phpinfo page as well. In my case it was enough to use the one provided by XAMPP.
After this, you have to enable the extension:
extension=oci8_12c
in the php.ini configuration file. It was enough for me to enable only this one, although some people suggests to also enable extension=pdo_oci. My suggestion is to try this only if you failed to install with the path here shown. It's also good to check if you are set in the correct path regarding the extensions, in my case:
extension_dir="C:\xampp\php\ext"
After this, you have to download the Oracle Instant Client. Since you are using x86 architecture (you must use this one), you need to find a 32-bit version of the OIC, but is also important to check which one is compatible with the extension you uncommented. In my case, of oci8_12c, it was instantclient-basic-nt-12.2.
The final step is to unzip it to a folder, like "C:\instantclient_12_2" and add it to the path variables of the system.
Reload apache and check if the OCI8 is shown correcly.

PHPWebAdmin not working - DCOM error, despite modifying permissions

I'm trying to set up PHPWebAdmin to work with an installation of hmail.
I understand that for php version 5.3.15 / 5.4.5 and higher the COM API has been disabled as a module.
I was using PHP version 5.3.21, I went ahead upgraded to PHP 5.4.24 and added the following to my php.ini
extension=php_com_dotnet.dll
Before the upgrade I was seeing the following error...
Fatal error: Class 'COM' not found in C:\inetpub\wwwroot\initialize.php on line 13
After upgrading PHP my error changes to...
Failed to create COM object `hMailServer.Application': Access is denied.
This problem is often caused by DCOM permissions not being set.
I followed the instructions here: https://www.hmailserver.com/documentation/latest/?page=howto_dcom_permissions
I granted the IUSR user the DCOM permissions after checking in IIS that this is the user used for default anonymous auth, but the error persists and I am stuck for things to try next.
Any suggestions?
Try this, I had the same issue and it worked for me:
1: Type dcomcnfg.exe at your command prompt
2: In the Component Services program, expand the Component Services folder
3: Expand down to Computers >> My Computer >> DCOM Config
4: Right-click on hMailServer and select properties
5: Select the Security tab
6: Under “Launch and Activation Permissions”, select Customize and click on Edit
7: “Group or user names”, click Add
8: Type IIS_IUSRS and click Check Names
9: Select and add the built-in anonymous IIS user account
That should do it. It did it for me.
For more details, see:
https://wiztelsys.com/blog/permission-issues-with-dcom-in-webmail/
The php 5.4.5 build from windows.php.net ships the com/dotnet module as extension dll. If that's the case with your version of php too you can enable the module via
extension=php_com_dotnet.dll
in your php.ini
check php.ini file and remove ; from
;com.allow_dcom = true

Cannot Start Wamp Server

For some unknown reason I cannot start WAMP server - The icon stays yellow no matter what:
Checked port 80, and it's not used.
No Skype, no Firewall.
Tried MANY solutions I suggested here in stackoverflow - absolutely nothing.
Tried to uninstall and reinstall - it worked for 10 minutes, then it didn't work again.
The only thing I'm changing is to include Virtual Hosts under httpd.conf. Checked every solution I could find on the net - nothing is working for me.
Maybe, just maybe it's because I previously installed PHP 5.5 apart from WAMP? If I go to PHP > PHP Extensions > then I can see there's a problem in php_opcache and php_enchant. When I click on them I get an error message that says: Could not execute menu item (internal error). [Execption] Could not perform service action: the service has not been started. The PHP Version I installed is 5.5.15. The PHP WAMP is 5.5.12... I don't have a clue how to uninstall PHP, and I couldn't find anything about that on the net.
PHP Error log says: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - %1 is not a valid Win32 application. in Unknown on line 0
EDIT - It seems like the cause for the problem is me trying to include Virtual Host via httpd.conf file. When I excluded, like in default, WAMP is online again. Any suggestion of how to include virtual host and still get WAMP get online?
It looks like you're running on a corrupt install have you tried reinstalling the software?
Alternatively i would recommend using Xampp which basically offers the same service as Wampp only with a bit more ease of access (also allowing for Mecury mail service and an FTP server for remote access).
The problem with php_intl can be corrected easily, see this answer
In order to find out what Apache is complaining about with the Virtual Hosts definition look at the Windows Event Log or, launch a command window and
cd \wamp\bin\apache\apachex.y.z\bin
httpd -t
This should give you filename and line number where your errors are.
Try changing that port number anyway. Mine stays yellow if the port number is set to 80, even though WAMP says it's not being used by any other program.

Not optimal PHP configuration detected on this machine

I'm trying to install PHPmyadmin in IIS 8, seem not success, because PHPmanager said "Not optimal PHP configuration detected on this machine". what does it mean? Anyone can help me to make PHPmyadmin works in IIS 8? Thank you!
Gary
I am not sure but maybe IIS and phpmyadmin are running on same port 80(default for both IIS and apache server).
Change the apache service for to something other than 80.
Look for line Listen 80 in apache configuration file and change it.
Does your IIS 8 support phpMyAdmin's requirements? Check that carefully. I had similar problem, read requirements, reconfigured sever - and et voilà! Check also ports - phpMyAdmin port has to be other that IIS port.
Session support. Make sure that sessions are configured properly (see
below) and session.cookie_secure is Off if you are not using a secure
connection (i.e. "https")
Either the mysql or mysqli extensions (more details)
The mbstring extension
GD2 support in PHP to display inline thumbnails of JPEGs ("image/jpeg: inline") with their original aspect ratio
PHP 4.3.0 or newer is needed to use the "text/plain: external" MIME-based transformation
If you are using the Hardened PHP Suhosin extension make sure to increase the values for suhosin.request|get|post.max_* see also
Suhosin Configuration and Hardened-PHP request limits. You can examine
some increased suhosin.x values on the demo server -> main page ->
Show PHP information, e.g., suhosin.post.max_value_length and
suhosin.request.max_value_length = 128000 . See also FAQ 1.38. Another
such obstacle is "mod_security" on fedora boxes, error: "Method Not
Implemented. GET ..."; a possible solution:
http://forums.theplanet.com/index.php?showtopic=89327 .
If any paths are defined in your php.ini like session.save_path or upload_tmp_dir make sure that they do exist and your os is able to
write to them. Especially on a Windows system "/tmp" does not exist by
default! Due to a broken WIN PHP 5.2 installer paths are definitely
wrong in that version bugs.php.net/bug.php?id=39842. Using IIS as
webserver you also need an user named "IUSR" or "IUSR_MACHINENAME"
with r/w/modify rights granted on those folders.
Not really a requirement but a strong suggestion: if you are using the cookie authentication method, having the mcrypt PHP extension on
your web server accelerates not only the login phase but every other
action that you do in phpMyAdmin
On 64 bit systems the mcrypt PHP extension is required for auth_type "cookie". The alternative blowfish routines only work on
32-bit systems at the moment (due to a PHP 5.2.0/1 bug, should be
fixed in PHP 5.2.2 meanwhile). The same issue leads to the cryptic
"#1045 access denied for user www-data.." messages on Ubuntu boxes.
If you have weird random problems also check out whether apc or eaccelerator is the culprit. If the problem is with APC it's possible
to prevent scripts in the phpMyAdmin directory from being cached with
apc.filters. For instance you can add something like this to your
php.ini: apc.filters = "-/usr/share/phpmyadmin/.*"

I cannot get WordPress running in local mode on Windows using GAE

There is a nice article https://developers.google.com/appengine/articles/wordpress
on how to get wordpress running under google app engine.
I am running under Windows 8 (64 Bit)
I followed the steps, installed Python and PHP used a MySQL instance I had running and added wp_user as described.
I verified that the helloworld app runs with GAE locally.
I verified that Mysql is running, wordpress_db exists and wp_user can connect as described in the article.
I created wp-config.php as described.
in php,ini in my php installation I uncommented the lines
extension=php_mysql.dll
When I run as described and hit localhost:8080 I get
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
extension=php_mysqli.dll
I tried installing http://wordpress.org/plugins/mysqli/
after putting db.php in wp_content localhost:8080 says
php failure (255) with: stdout:X-Powered-By: PHP/5.4.20 Content-type: text/html stderr:
Stdout on the command line says
ERROR:root:php failure (255) with:
stdout:
X-Powered-By: PHP/5.4.20
Content-type: text/html
OK I am stuck - someone has gotten this running on windows but I see no troubleshooting information and am a newbie on PHP and Wordpress which I am using for political reasons
Can anyone out there offer any help
If you're not limited to the GAE then perhaps WAMP or XAMPP is a better bet? WAMP is fairly nice as it's a clicky-button installer with minimal knowledge required. Once it's installed, you should see a green "W" in your tray and all you need to do is point a browser to http://localhost.
I had the same issue and tried out all kind of things, ending up uncommenting the line:
extension=php_openssl.dll
In the php.ini file in my application folder. That did the trick and WordPress is now running in my dev environment.
I had the same problem as well, and after much trial and error I realized that I needed to specify the full path in php.ini
Although the tutorial only includes the line google_app_engine.enable_functions = "php_sapi_name, gc_enabled" you will need to add the extension=PATH line where PATH is the full path to your php installation, e.g.
google_app_engine.enable_functions = "php_sapi_name, gc_enabled"
extension=C:\Users\YOUR\php\ext\php_mysqli.dll

Categories