Production server not recognizing Symfony folder path - deployment

Just delpoyed my symfony website to the production server and I am getting this issue:
Anyone wonder what's up ?
require_once(/home/vsource4/www/students/lib/vendor/symfony-1.4.14/symfony-1.4.14/lib/autoload/sfCoreAutoLoad.class.php) [function.require-once]: failed to open stream:
No such file or directory in /home/vsource4/www/students/sfproject/config/ProjectConfiguration.class.php on line 4
This is not the case, because my symfony installation does exist here:
/home/vsource4/www/students/lib/vendor/symfony-1.4.14/symfony-1.4.14/
Now what can be a good reason herE?
<?php
require_once('/home/vsource4/www/students/lib/vendor/symfony-1.4.14/symfony-1.4.14/lib/autoload/sfCoreAutoload.class.php');
sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('sfDoctrinePlugin');
$this->setWebDir('/home/vsource4/www/students/sfprojects/web');
// $this->setWebDir($this->getRootDir().'/web');
}
}
I have used absolute paths, the paths are correct.
thanks

Tried clearing the symfony cache?

Related

TYPO3 GeneralUtility Class 0; not found (own generic extension)

After creating my own Extension with the ExtensionBuilder-Package and activating it, I created a repository for the data and set the Storage-PID in the Template-Constants.
Then I created a new page containing the extension (with default values) and on viewing the page the following error appears and the page does not show:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Class '0;' not found | Error thrown in file /var/www/html/typo3Insy/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php
For the setup I used the TYPO3 version 9.5.23 and have not migrated from a previous one.
Thanks to #Jack70 I found out, that an autoloader needs to be supplied for my own extension in the composer.json-File of the TYPO3-installation itself.
From the composer.json-File of the created extension itself, you can extract the vendor name and the site package. Make sure the case matches when supplying it to the autoloader-section:
"autoload": {
"psr-4": {
"MyVendor\\MySitePackage\\": "pathToTheClassesDirectoryOfYourExtension"
}
}
After that you can simply run composer dump-autoload and this error will be fixed (without restarting the webserver).
I found out about this here: https://wiki.typo3.org/Exception/CMS/1289386765

Setting up SimpleSAMLphp as a SP for CodeIgniter

I have to continue on an already existing CodeIgniter 3 application (not written by me) which contains multiple applications for different customers, the project structure looks a little like this:
root/
applications/
customer1/
config/, controllers/, models/, views/, ...
third_party/
SimpleSAMLphp/
config/, metadata/, www/, ...
lib/
_autoload.php
customer2/
...
assets/, bundle/, ...
customers/
customer1/
assets/, index.php, ...
customer2/
...
system/
vendor/
composer/
autoload.php
Now for one of the applications I have to replace the ion_auth system with an SSO (setup as a Service Provider from their IdP metadata). I googled a lot and tought SimpleSAMLphp would be my best option.
But I am really struggling just even putting the SimpleSAMLphp SP API into my application and the documentation isn't great.
-I "include_once" the third_party/SimpleSAMLphp/lib/_autoload.php file in the customers/customer1/index.php file (before require_once BASEPATH...)
-I modified third_party/SimpleSAMLphp/lib/_autoload.php so it finds the vendor/autoload.php file
I expect to be able to use the methods of the SimpleSAMLphp library but instead I get the following errors:
-If I follow the code in this guide:
Fatal error: Call to undefined function SimpleSAML\Auth\Simple()
-If use include APPPATH . 'third_party\SimpleSAMLphp\www\index.php in my controller just above the code from above tutorial:
Fatal error: Class 'SimpleSAML\Error\Assertion' not found in
What am I doing wrong in my setup?

After Deploying, ASP.NET application showing Internal server error

I deployed my ASP.NET application to a remote server with a hosting company, and when i try to send data from Postman, i get the internal server error with no definite error message. I have set custom error mode to off in the web config file. please can anyone help me? I have checked for several solutions but nothing.
PS: i am new to ASP.NET deployment with other companies apart from Azure
In this case, you should log error to file to see what issues in deployment mode.
This way i implemented global error log.
public class ExceptionHandlingAttribute : ExceptionFilterAttribute
{
public override void OnException(HttpActionExecutedContext context)
{
//Log Critical errors
// You can use log4net library and configure log folder
}
}
In WebApiConfig.cs file you register it.
public static void Register(HttpConfiguration config)
{
// .....
config.Filters.Add(new ExceptionHandlingAttribute());
}

Why I get 500 Error while on XAMPP while loading CodeIgniter 3 database library?

I have gone through number of threads on stackoverflow and on other forums to find the answer but could not find relevant answer. People have applied different approaches but none has worked for me thus far.
I am using CI 3 on XAMPP and whenever I load database library in the model, I run into 500 Error.
Here is my CI database config info:
'hostname' => 'localhost',
'username' => 'my_user',
'password' => 'my_pass',
'database' => 'prod_db',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
PHP ini db libraries are as below:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
My model code is as below:
class loginmodel extends CI_Model {
public function validate_login($username, $password) {
$this->load->database();
$var = 0;
return $var;
}
}
Whenever I remove $this->load->database(); from the model, my code runs and i am able to redirect to a "Login Failed" page. BUT, whenever I load my database library in autoload.php or load it in above model, code fails.
Autoload.php
$autoload['libraries'] = array('database');
Apache error logs showed below errors but I could not figure as why this was happening.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_pdo_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0
Please advise.
EDIT:
I verified all config to be OK and as stated in the comments, I added environment variables to windows and verified through PHPInfo that mysqli and mysqlnd were loaded.
Despite getting all the config right, error still persisted and I did a clean install of CI to reproduce library load failure. This time CI returned an error that db access was denied.
I then realized that after migration, database user was not created in the new environment. So once I created the desired user and assigned it required privileges, I was able to run the code just fine.
Therefore, if anyone encounters such issue in future, below steps might help:
First and foremost, verify if your desired user can access the
database.
Modify your .htaccess to use your desired URL schemes only after
verifying that database connection is working
Then verify that absolute path is available in PHP.ini on XAMPP.
Plus, verify that PHP is added in the environment variables. My
Values on Windows 10 are as follows: Variable Name: PHP , Variable
Value: C:\xampp\php\ext
In CI, mysqli is selected as database driver
In PHP.ini mysqli extension is enabled. i.e. php_mysqli.dll
Echo PHPInfo to verify that mysqli and mysqlnd are available in your
installation.
If nothing works, do a clean install of CI on a separate directory and load database library after setting up your database configuration and before setting up .htaccess until you can reproduce the error.
Hope that error will be eliminated!

Configuring modules in ZendFramework

I have a problem using modules in ZendFramewok. I have so far created the directory sturucture for modules in application directory.
Application
--configs
--Bootstrap.php
--modules
----default
------controllers
--------ErrorController.php
--------IndexController.php
------models
------views
--------helpers
--------scripts
----------error
------------error.phtml
----------index
------------index.phtml
Updated application.ini by adding the following lines:
resources.frontController.moduleDirectory = APPLICATION "/modules"
resources.module[] = ""
Setup Virtual host for public as ServerName.local
So if type in browser Servername.local I get the default view, but if I type Servername.local/:default/:index/:index I get a 403(Forbidden), if I type Servername.local/default/index/index I get a 404(Not Found), any help??
I believe your missing an "s" on resources.module[], might want to update that to:
resources.modules[] = ''
First of all check if mod_rewrite enabled and configured in .htaccess. I believe this 404 error coming from server and not from your application.
After that check your index controller defined as followed: Default_IndexController extends Zend_Controller_Action
If this is not your issue i'll throw in more suggestions.