Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:10
    kgamecarter starred peachpiecompiler/peachpie
  • 13:50

    jakubmisek on master

    dynamic conversion Nullable`1 -… (compare)

  • 13:44
    jakubmisek commented #918
  • 13:44
    jakubmisek commented #918
  • 13:14
    jakubmisek commented #914
  • 10:11
    dirant commented #914
  • 09:16
    ceicomcloud edited #918
  • 08:48
    ceicomcloud edited #918
  • 08:44
    ceicomcloud edited #918
  • 08:40
    ceicomcloud opened #918
  • 04:34
    chungonion starred peachpiecompiler/peachpie
  • Feb 25 19:50

    jakubmisek on master

    dynamic conversion to System.De… (compare)

  • Feb 25 19:44

    jakubmisek on master

    compile-time conversion to Syst… (compare)

  • Feb 25 19:34

    jakubmisek on master

    PhpCallableToDelegate helper st… (compare)

  • Feb 25 19:13

    jakubmisek on master

    socket_set_blocking() build fix (compare)

  • Feb 25 19:05
    jakubmisek commented #915
  • Feb 25 19:04
    jakubmisek closed #915
  • Feb 25 19:04

    jakubmisek on master

    stream_set_blocking() for socke… (compare)

  • Feb 25 19:01
    dirant commented #914
  • Feb 25 18:48
    jakubmisek commented #914
MuriloPazzini
@MuriloPazzini
I have deployed the application on a IIS server with .net core 3.1 hosting bundle installed, but when I open it with the server url I experience a long loading and a redirect to the same address but with port 44344
has anyone experienced something like this?
btw the application runs normally locally
MuriloPazzini
@MuriloPazzini
still here if anyone wants to help
Jakub Míšek
@jakubmisek

@MuriloPazzini the long loading is caused by port 44344 which is your server not listening on (probably).

Isn't it possible you have the wrong port number in the configuration?

Asp.net core might automatically redirect you there

MuriloPazzini
@MuriloPazzini
@jakubmisek so, should I add a binding for port 44344?
The app is only an empty asp.net core project with dotnet wordpress and I followed all the configuration and works fine locally, so I don't have the section https_port in my appsettings.json and the Program.cs is the default one.
Jakub Míšek
@jakubmisek
@MuriloPazzini it shouldn't be redirecting to port 44344 in the first place. So somewhere is a configuration that enforces automatic HTTPS redirection with that port I guess.
MuriloPazzini
@MuriloPazzini
Ok, I'll check if somewhere it has a config for port 44344, the only configuration it has for now is enforcing https in the Startup with UseHttpsRedirect
Jakub Míšek
@jakubmisek
UseHttpsRedirect() is causing it - but it redirects to 44344 instead of 443
MuriloPazzini
@MuriloPazzini
image.png
this was the problem
just found it, the initial configuration set these redirects and they went crazy when I deployed my application on IIS
Jakub Míšek
@jakubmisek

@MuriloPazzini so the WordPress was installed on IIS already, with a wrong URL in DB.

Usually, site admins are forcing SITEURL and HOMEURL constants to override this settings (it also improves performance), the constants can be set in appsettings.json (or appsettings.production.json etc.)
https://github.com/iolevel/wpdotnet-sdk#appsettingsjson

scrawlon2
@scrawlon2
I'm trying to add define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL); to wp-config.php. For other define statements, I'm using the "constants" object in appsettings.json, but MYSQLI_CLIENT_SSL isn't a valid json value. Is there a work around for this situation? Thanks.
Jakub Míšek
@jakubmisek

@scrawlon2 that's a good question! Currently, you have to pass the actual value, which is 2048.

From what I see, SSL should be enabled by default, since there is no reason to disallow it on .NET; the next update won't require it.

scrawlon2
@scrawlon2
@jakubmisek That makes sense. I can just use 2048 then. Thanks. Glad to hear SSL will be enabled by default in the future.
josephdfoley
@josephdfoley

I've got another odd issue that I can't seem to track down. The application i'm porting contains some quasi-restful endpoints written using laravel. I've got most of it working, but the endpoint returns the contents of the cached services.php before the actual json response every time. After inserting a bunch of echo statements, I tracked it down to this code:
/**

 * Get the returned value of a file.
 *
 * @param  string  $path
 * @return mixed
 *
 * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
 */
public function getRequire($path)
{
    if ($this->isFile($path)) {

--> return require $path;
}

    throw new FileNotFoundException("File does not exist at path {$path}");
}

The $path in this case is not compiled, it's on the filesystem. The output into the response stream looks like a dump of the variable returned by the loaded script, not the literal contents of the file because the file has a <?php tag, but the output doesn't.
Any idea what's happening here?

I should mention this is with -preview5
josephdfoley
@josephdfoley
So, this appears to be deliberate. If a file isn't compiled, the path is passed to the php function readfile() which uses fpassthru to write to the ctx outputstream, which in this case is the HttpResponse. But that doesn't happen using php-7.x. I'm not sure what exactly should be happening here.
armache
@armache
Has anyone successfully migrated existing mysql database into a new database?
Daniel Llewellyn
@diddledan
armache, any random mysql db or a WordPress.net one? WordPress requires care when moving database stuff about, but random mysql databases are doable with mysqldump to save the data and mysql to reimport it
Jakub Míšek
@jakubmisek
@josephdfoley yes, for the version 1.0.0 the compiler does not compile on the fly, so everything has to be pre-compiled. The use of readfile() was not the luckiest choice here. The recommendations are:
  • compile files you want to be compiled, including the one passed to $path
  • watching Visual Studio's Output Window when debugging, where all the PHP/PeachPie notices and warnings are printed.
@armache we usually just use the same database for wpdotnet as we had for regular WordPress. Not using any of that fancy WordPress export/import plugins, but they work too tho.
scrawlon2
@scrawlon2
Anyone running Peachpie WordPress on Docker? Can you share your Dockerfile? I'm trying to get the sample app running on port 80, so I can test multisite.
armache
@armache
@diddledan thanks for the response. I am trying to migrate my wordpress database (mysql) into a new database - I've tried both self-contained file and folder import/export but neither of them worked out.
Daniel Llewellyn
@diddledan

@armache Are you on a self-hosted environmnet or azure or?

if self-hosted, have you tried mysqldump? it's part of the mysql server installation.

if you're on azure you can do a database snapshot/backup but I don't remember the specifics of how

armache
@armache
@diddledan I am on Azure VM, I can backup/restore my wordpress db, but after restoring I am getting WSOD (white screen of death). So I am trying to figure out where I am going wrong. I had a website with flash-blog theme and a single post with images. After getting latest changes to source code my website is broken. I've started from scratch and it turns out that flash-blog theme is not working with the latest source code, so I changed the theme. Now I am trying to restore my single post. Please advise.
Jakub Míšek
@jakubmisek
@scrawlon2 the docker file would be similar to https://docs.docker.com/compose/wordpress/ but I haven't tried yet. AFAIK multisite is officially not supported yet although it should work. Please feel free to report any issues so we can fix it
scrawlon2
@scrawlon2
@jakubmisek I'm familiar with that docker file, but it creates a WordPress LAMP stack. I was hoping to find something like the docker file in the peachpie web-application sample that works with PeachPie WordPress. I'll report back if I manage to figure it out. I know multisite isn't officially supported, but I'm still interested in testing it out. Thanks.
Jakub Míšek
@jakubmisek
@scrawlon2 My only guess is it needs another docker file, that composes this one with aspnetcore/PeachPie with MySQL docker image. The same approach as in https://stackoverflow.com/questions/57545330/creating-a-simple-dot-net-core-and-mysql-docker-container-composition .
secreteagle
@secreteagle
newbie to peachpie, php "function not found" for bzcompress, or it confuses the current namespace for bzcompress ..is it possible to load a PHP extension DLL in peachpie? thx any help appreciated
Jakub Míšek
@jakubmisek
@secreteagle welcome - bzcompress is not (yet) implemented in peachpie. Since everything is in managed code, even extensions have to be reimplemented and native PHP DLL's cannot be loaded.
PeachPie will notify you about the unknown function in compile-time in advance:
warning PHP5006: Call to undefined function: 'bzcompress'
Namespaces are taken into account.
armache
@armache
Ok, so migrating database is not enough to recreate WP website. After some googling, I've also copied wp-admin, wp-content, and wp-includes folders from my live website into new solution. After that build is failing. Does anyone here knows how to recreate WP website? @jakubmisek @diddledan
Jakub Míšek
@jakubmisek
@armache as I know, only wp-content/uploads needs to be copied and your plugins installed again
armache
@armache
@jakubmisek Thanks, finally it worked out! I had to manually update settings in update wp_options table as well.
scrawlon2
@scrawlon2

@jakubmisek I managed to put together a working docker-compose for the peachpie-wordpress app. For anyone interested, i forked the repo and added a 'docker' branch: scrawlon/peachpie-wordpress

The 'dotnet watch run' command executes in the container, so you need to view the container log to see when it's "ready".

Scrawlon
@scrawlon
@jakubmisek Using the above Docker setup, I was able to create a WordPress multisite with PeachPie. I know it's not officially supported/documented yet, but it seems to be working for me so far.
tevo
@tevoza

Hi, newbie student here tasked with a peachpie investigation.
Would like guidance regarding the installation of the WordPress plugin "WooCommerce." I have successfully added other smaller php plugins and themes, in a separate php class lib as shown in a few available demos.

However when attempting to compile WooCommerce, I run into several Type name 'SomeClass' could not be resolved. errors.
This does make sense, because grepping through the the WooCommerce directory confirms that several of these classes are referenced but are not defined, which seems rather perplexing to me. I made doubly sure that all the files were available.
Any guidance would be appreciated. Thanks!

Jakub Míšek
@jakubmisek
hi @tevoza - that's great progress. This error (peachpiecompiler/peachpie#768) really means that the code depends on something that is not defined. There are two usual solutions:
  • Either exclude the files that won't compile in case they are not actually used. Usually, you can safely exclude test files, or files that are included conditionally but the condition never happens.
  • and/or add missing sources that define those missing classes/interfaces.
aankur81
@aankur81
Hello Everyone, is there a way we can use wpdont in .net framework project ?
Benjamin Fistein
@bfistein
In essence, yes, please see: https://docs.peachpie.io/scenarios/beginner/full-net-framework/. Feel free to post questions here if anything will be unclear.
aankur81
@aankur81
Thanks @bfistein .. sure will ask ..
Jakub Míšek
@jakubmisek
@aankur81 we have to prepare a specialized NuGet package for AspNet. Currently, it only targets .NET Core (and .NET 5). With the link above, you might be able to make it running if all steps done correctly.
aankur81
@aankur81
@jakubmisek yes.. i will follow steps and try to generate the exe as mentioned..
Noob Software
@siggi90
I'm trying to use PeachPie in a Xamarin.Mac project, according to this article https://www.peachpie.io/2017/11/php-netstandard-2-0.html PeachPie works on .NetStandard therefore on Xamarin.Mac but i'm having trouble adding the PeachPie.App nuget package, specifically: Could not install package 'Mono.Posix.NETStandard 1.0.0' because it doesn't target Xamarin.Mac, is Xamarin.Mac no longer supported or am i going about this the wrong way?
Jakub Míšek
@jakubmisek
@siggi90 Xamarin (android, osx, etc) should be supported, but we not tested it after we have added the Mono.Posix dependency. The package is basically not needed on mobile platforms anyways
Noob Software
@siggi90
@jakubmisek is it possible to add PeachPie.App to a project without adding Mono.Posix? I was also looking at this: https://www.peachpie.io/2018/04/packing-php-into-dll.html Is it correctly understood that if I use Peachpie.NET.Sdk to build the DLL i won't have to add peachpie dependencies to a project?
Noob Software
@siggi90
@jakubmisek or do you mean it's not necessary to add the PeachPie.App nuget package to mobile projects?
Jakub Míšek
@jakubmisek
Peachpie.NET.Sdk implicitly adds all the dependencies
Noob Software
@siggi90
It's impossible to add PeachPie.App 1.0.0.preview5 due to dependencies on Mono.Posix and also impossible to add stable version because of dependencies to Sixlabors.Fonts, although PeachPie.App 1.0.0.preview2 works. It would be very good if you would consider the Xamarin.Mac platform with next stable release, since Mono.Posix is not supported there.